hormesis
Contributor
Contributor

FreeBSD: NAT broken with e1000 network, works with vmxnet3 + EFI firmware...

This has taken me the better part of a weekend to diagnose and troubleshoot, but on VMware Fusion 8.5.5 with the `e1000` driver configured (`ethernet0.virtualDev = "e1000"`), TCP connections would randomly stall after a few MB of downloads.  After much consternation, handwringing, and yelling, I finally found the combination that appears to work 100% of the time:

In the `.vmx` file for the VM, add or update the lines with the following values:

firmware = "efi"

ethernet0.virtualDev = "vmxnet3"

Inside of the guest configure the use of the vmx(4) network driver, in my case FreeBSD, add:

echo 'if_vmx_load="YES"' | sudo tee -a /boot/loader.conf

Make sure to change the settings in /etc/rc.conf from em0 to vmx0 and you should be good to go.

If someone at VMware could add these nuggets of wisdom to their documentation someplace where it's indexable by search engines, that would be hugely appreciated.

UPDATE:

If you connect to your guest using a TCP connection where there is no activity and/or no application-level (layer 7) heart beating, you need to enable TCP keepalives on the client, too.

$ sudo sysctl net.inet.tcp.always_keepalive=1

$ echo net.inet.tcp.always_keepalive=1 | sudo tee -a /etc/sysctl.conf

There are two fixes that are required: 1) Use the vmxnet3 driver as stated above, and 2) Update the host to use TCP keepalives.

0 Kudos
0 Replies