diff --git a/containers/vrouter/base/agent-functions.sh b/containers/vrouter/base/agent-functions.sh index f71c87fba..08a663079 100644 --- a/containers/vrouter/base/agent-functions.sh +++ b/containers/vrouter/base/agent-functions.sh @@ -181,9 +181,10 @@ function get_physical_nic_and_mac() } # Find the overlay interface on a ContrailVM -# ContrailVM is spawned with nic ens160, which is the primary interface +# ContrailVM is spawned with nic ens160, which is the primary/mgmt interface # Secondary nics (like ens192, ens224) are added during provisioning -# The overlay interface will have name ens* and not have inet* configured +# The overlay interface will have name ens*, be of type vmxnet3 +# and not have inet address configured # This function uses this logic to find the overlay interface and # return as vmware_physical_interface. function get_vmware_physical_iface() { @@ -192,11 +193,16 @@ function get_vmware_physical_iface() { local iface_list=`ip -o link show | awk -F': ' '{print $2}'` iface_list=`echo "$iface_list" | grep ens` for iface in $iface_list; do - ip addr show dev $iface | grep 'inet ' > /dev/null 2>&1 - if [[ $? == 0 ]]; then - continue; + local intf_type=`ethtool -i $iface | grep driver | cut -f 2 -d ' '` + if [[ $intf_type != "vmxnet3" ]]; then + continue; else - vmware_int=$iface + ip addr show dev $iface | grep 'inet ' > /dev/null 2>&1 + if [[ $? == 0 ]]; then + continue; + else + vmware_int=$iface + fi fi done if [[ "$vmware_int" == '' ]]; then