One day, my dad came up with a problem in his office network. They were upgrading the network infrastructure, and in doing so, had to assign different Internet gateways for each VLANs and also had to perform inter-VLAN routing using an L3 switch. He himself had a solution and asked me about it. I said, ‘yeah it should work for sure’. The solution was,
- Assign the respective Internet gateway IPs as the default gateway of the respective VLAN PCs. This way, each user has access to the Internet. (The Internet gateway a particular VLAN must use belongs to the same VLAN)
- Now add a static route to each PC’s route table, to route all internal packets to the corresponding VLAN management IP. This makes way for inter-VLAN routing through the L3 switch.
route -p add 192.168.0.0 mask 255.255.0.0 192.168.10.1
This command adds a static route to the Windows route table, which says, route all packet that belongs to the 192.168.0.0/24 network or subnets to 192.168.10.1(which is the management IP of, say VLAN10)