ESXi 7.0 with USB Ethernet Adapters

I spent some time tinkering with a home router setup over the last couple of days – now its running OPNSense and several other VM’s in an ultra small form factor machine. The goal was to migrate some services, notably those of the Omada / TP-Link wireless mesh network controller and some active directory servers (Microsoft DNS – is far less of a headache to configure) to the same machine.  Also, ESXi is freely available. The struggle, which i initially attributed to comcast – because why not – was the WAN port on the OPNSense / PFsense router vm not picking up an IP address without juggling USB dongles / modem resets etc.  The answer to the issue can be found here in great detail.  Apparently, ESXi does not (for obvious reasons) exactly support USB NICS – so we simply add a small script to rc.local which polls the boot process until the USB NIC is available.  Interestingly,  this restores functionality, but the nic does not appear in any network diagrams within the ESXi web interface.

Persisting USB NIC Bindings

Currently there is a limitation in ESXi where USB NIC bindings are picked up much later in the boot process and to ensure settings are preserved upon a reboot, the following needs to be added to /etc/rc.local.d/local.sh based on your configurations.

1
2
3
4
5
6
7
8
9
10
11
12
13
vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')
count=0
while [[ $count -lt 20 && "${vusb0_status}" != "Up" ]]
do
sleep 10
count=$(( $count + 1 ))
vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')
done

esxcfg-vswitch -R

/etc/init.d/hostd restart
/etc/init.d/vpxa restart

Note: The vusbX vmkernel interface may not show up in either ESXi Embedded Host Client and/or vSphere HTML5 UI, this does not mean there is an issue. ESXi was never designed to support USB-based NICs for Management Network and the UI may not properly detect these devices when using the UI. It is recommended to use the ESXi Shell for any operations requiring configuration of vusbX devices.  In the above example, I have added two lines to restart the WebUI after the network is initialized – this navigates the issue eliminating it entirely!

An Alternative

The above mentioned process works – very reliably.  However, if you have a managed switch you can simply create a new VLAN for your uplink / ISP bridge and run your router off one cord.  Now there may be some bandwidth considerations with this method, but in practical terms it works.  This guy agrees.

LAN Network Configuration vlan (x1) for a seperate subnet.
WAN Configuration on USB Adapter
Lima

About the author

Lima is the visual nautical indicator for "stop instantly."

Comments

Leave a Reply