Configure Multiple Subnet (Default) Gateways on a Single VLAN

I was recently helping a colleague troubleshoot some networking configuration for a NetScaler SDX. We started looking at the switch side config to ensure what information he had received was accurate and properly setup. I tested this quickly in my lab on a Cisco 3750G switch with my vSphere environment. I already had a VLAN that I use and wanted to try adding an additional gateway within it. After some searching around on the Cisco forums, I found the command to achieve this.

ip address 192.168.140.1 255.255.255.0 secondary

By setting this secondary, I was able to take an existing VM in the subnet 192.168.14.13 and re-ip it to 192.168.140.13 and set the default gateway to 192.168.140.1. All communication still worked perfectly between both subnets while still in VLAN 14. I’ve included all of the CLI below.

config t
int vlan 14
ip address 192.168.140.1 255.255.255.0 secondary
end

sh run
interface Vlan14
ip address 192.168.140.1 255.255.255.0 secondary
ip address 192.168.14.1 255.255.255.0
!

One thought on “Configure Multiple Subnet (Default) Gateways on a Single VLAN

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.