VLAN Routing


Let’s say that I have a GigE WAN connection from AT&T connected to a layer 3 switch. The switch has many VLANs being routed by RIP (I know, dumb) but that is what it is.

When a customer accesses this switch via the WAN to connect to an application running on a server that may be on one of the VLANs, what happens?

Hello Wes,

It really depends on the configuration of your interfaces. Since it’s routing for multiple VLANs, your config probably looks similar to this:

Switch(config)#interface GigabitEthernet 0/1
Switch(config-if)#description DESKTOPS
Switch(config-if)#switchport access vlan 10

Switch(config)#interface GigabitEthernet 0/2
Switch(config-if)#description SERVERS
Switch(config-if)#switchport access vlan 20    

Switch(config)#interface vlan 10
Switch(config-if)#description DESKTOPS
Switch(config-if)#ip address

Switch(config)#interface vlan 20
Switch(config-if)#description SERVERS
Switch(config-if)#ip address

Your switch ports are in different VLANs and you have an SVI interface with an IP address for each VLAN.

Let’s say you are connected to AT&T with a routed port, something like this:

Switch(config)#interface GigabitEthernet 0/3
Switch(config-if)#no switchport
Switch(config-if)#description AT&T 
Switch(config-if)#ip address
Switch(config-if)#ip address 

As an L3 switch (with IP routing enabled), it will route between these subnets:

Switch#show ip route     
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set is variably subnetted, 2 subnets, 2 masks
C is directly connected, GigabitEthernet0/3
L is directly connected, GigabitEthernet0/3 is variably subnetted, 2 subnets, 2 masks
C is directly connected, Vlan10
L is directly connected, Vlan10 is variably subnetted, 2 subnets, 2 masks
C is directly connected, Vlan20
L is directly connected, Vlan20

So if an IP packet entered the AT&T interface with destination, it would get routed out of the VLAN20 interface. The switch then checks its ARP table to figure out if it knows where is, learns the MAC address, then switches it out of one of the switch ports.

I hope this helps!