I have two VMware vSphere 5.1 hosts.
Each host is connected via a switch to gateway 192.168.20.1.
Currently both hosts have their vSwitches using network 192.168.20.0.
I'd like to have the two hosts use different subnets, but still use the same gateway. For example, one vSwitch using 192.168.30.0 but connecting to gateway 192.168.20.1.
Is this possible to configure within vSphere?
Thanks!
Not the way you want. You just can't have a client use a gateway that's in a different subnet than its IP address, and that's a networking restriction, not a VMware one.
Having said that, why do you care about them using the same gateway? This makes little sense to me, and I'd suggest that the solution is probably to just forget about having them use the same gateway.
Basically this issue is related to networking, if VxLAN is implemented in your network environment then yes you can assign multiple subnets in VMware otherwise no.