VMware ESXi – Add Secondary IP to ESXi Host from Different Subnets

iprouteroutervmware-esxi

I have to add a secondary IP to an ESXi host running ESXi 6.5. My objective is to allow communication between some machines running on a different local network and the VMs present inside ESXi through a secondary interface. Here is a map depicting my intention:
enter image description here

As you can see, I have a primary router connected through the primary interface with 192.168.1.0/24 and I need to connect to the other network managed by another router with a different IP range (192.168.6.0/24).

I tried to create a new port group connected to a new vSwitch that has a new VMKNIC and I created a new custom TCP/IP stack.
The problem is that:

  1. I can set the gateway neither from the CLI nor from the interface in the new TCP/IP stack.
  2. The VMs connected to the new vSwitch do not reach the other machines, even if they are correctly configured.

Any suggestion is more than welcome!

Best Answer

For what I understand you want to connect the 2 LANs using the host, this will not be possible, the host will not act as a router.

Having 2 interfaces in the host will only make it to be part of both LANs (if they are able to reach the GW), but you can not add the capability of redirect/route the traffic from one interface to the another inside the host.

For doing that, you need to fix your routing in the routers, having a direct connection between them and having a routing protocol enabled