VMware Cloud Community
rtr1129
Contributor
Contributor
Jump to solution

ESXi 5.1 host loses default gateway

I have an ESXi host with one pNIC and two vSwitches. The "outside" vSwitch is connected to the pNIC and pulls DHCP for it's VMkernel port, and the other is for an internal LAN for VMs and has a static IP for its VMkernel port. There is a firewall VM that connects the two vSwitches and handles NAT. It all works fine until the host reboots and pulls DHCP on the "outside" vSwitch, but then the "inside" vSwitch takes the same default gateway as the outside vSwitch. The firewall VM still handles a VPN tunnel fine, so my offsite backups keep running, but when the "inside" VMkernel's gateway gets changed I can't connect to it over the VPN tunnel. I can change the gateway back manually and it works as expected, but it doesn't stick. See attached screenshots to get an idea of the config. It's ESXi 5.1.0 799733.

0 Kudos
1 Solution

Accepted Solutions
weinstein5
Immortal
Immortal
Jump to solution

The issue is an ESXi hosts vmkernel can only have a single gatewat address assigned -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

View solution in original post

0 Kudos
2 Replies
weinstein5
Immortal
Immortal
Jump to solution

The issue is an ESXi hosts vmkernel can only have a single gatewat address assigned -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
rtr1129
Contributor
Contributor
Jump to solution

Thanks, good to know. I got this working by adding this line to /etc/rc.local.d/local.sh:

esxcli network ip route ipv4 add --gateway 10.18.3.1 --network 192.168.61.0/24