IT141 · SESSION 3 · FIELD NOTES

Inter-VLAN Routing: The Wrong Door

Last session, VLANs sealed the departments off from each other. That was the point, but now Front Desk can't send anything to Logistics at all. Something has to route between the VLANs. This session does it twice: first R1 learns to wear one hat per VLAN on a single cable (router-on-a-stick), then a new Layer 3 switch, D1, takes the job over. The hosts never notice the swap, because a gateway is an address, not a box.

New material Module 4 — Inter-VLAN Routing Network change D1 (Layer 3 switch) joins HQ Next session Group exam 1–4; Module 5 — STP

Module 4

What Session 3 covers

One module, four topics, in NetAcad's order: what inter-VLAN routing is and the three ways to do it; router-on-a-stick; inter-VLAN routing on a Layer 3 switch; and troubleshooting both.

Cold open · Local Dispatch, the morning after

The walls went up yesterday, and by nine the phone is ringing. "Logistics can't send us anything," says Front Desk. "We can't send them anything either," says Logistics. The Rookie checks: PC-D can't even reach its own gateway. "Of course not," says the Surveyor. "We built three departments and gave the building one door. R1's LAN port is plugged into a Front Desk port, so it's Front Desk's door and nobody else's." The crew chief is already wheeling in a new box with a lot of ports on the front. "Two fixes," she says. "This morning, R1 learns to be three doors on one cable. This afternoon, this thing takes over, and nobody at a desk changes a single setting." On the whiteboard behind her, someone has drawn a door with a question mark on it.

Topology used on this page HQ as Session 2 left it: VLANs 10, 30, 99 and 900 on S1 and S2, joined by the F0/23 trunk. The page routes between those VLANs twice. First R1 does it with router-on-a-stick on G0/0/1, through a trunk on S1 G0/1. Then D1, a Catalyst 3650 Layer 3 switch, takes over. R1 G0/0/1 links to D1 G1/0/24 on 10.0.0.8/30 (R1 .9, D1 .10), and S1 G0/1 is trunked to D1 G1/0/1. PC-C and PC-D get their IPv6 addresses automatically.
VLANGatewayRouter-on-a-stick: who answersLayer 3 switch: who answers
10 FRONT-DESK192.168.10.1R1 G0/0/1.10D1 Vlan10
30 LOGISTICS192.168.30.1R1 G0/0/1.30D1 Vlan30
99 MGMT192.168.99.1R1 G0/0/1.99D1 Vlan99
900 NATIVEnoneR1 G0/0/1.900 (no address)— (no SVI)

Same addresses in both columns. That's the whole trick of this session: the gateway address stays put, and only the device behind it changes.

Module 4.1

Why VLANs need a router, and three ways to give them one

A VLAN is a broadcast domain, and a subnet. Traffic between two subnets has to be routed, so traffic between two VLANs has to be routed too. That's inter-VLAN routing.

CCNA 1 callback In CCNA 1 you learned that a host sends anything for another network to its default gateway, and that a router interface is the edge of a broadcast domain. Both rules still hold. Each VLAN needs its own gateway address in its own subnet, and each host's gateway must be the one for its own VLAN. A PC in VLAN 30 with gateway 192.168.10.1 is knocking on the wrong door: that address isn't in its subnet, so it can't even reach it.
LegacyRouter-on-a-stickLayer 3 switch
Gateway lives onOne physical router interface per VLANOne router subinterface per VLAN, all on one physical interfaceOne SVI per VLAN, on the switch itself
Switch sideOne access port per VLANOne trunk to the routerNo router link needed for inter-VLAN traffic
Scales?No: you run out of router portsModerately: every VLAN shares one link's bandwidthYes: routing happens in switch hardware
Where you'll see itOlder networks, and the history of the other twoSmall sites and branchesMost enterprise campus LANs
This courseNot builtFirst, on this page; again in the Session 12 practice labSecond, and permanent from now on

Module 4.1

Legacy inter-VLAN routing

The oldest method: give the router one physical interface for each VLAN, and cable each one to an access port in that VLAN. It works, and it's simple to read. It also means two VLANs cost two router ports and two switch ports, and twenty VLANs cost twenty of each. Routers don't have that many Ethernet ports, which is why nobody builds it any more. You'll only see it here, as a snippet. We aren't building it.

R1 · legacy, one port per VLAN (illustrative only)
R1(config)# interface g0/0/1 R1(config-if)# ip address 192.168.10.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# interface g0/0/2 R1(config-if)# ip address 192.168.30.1 255.255.255.192 R1(config-if)# no shutdown
S1 · one access port per VLAN (illustrative only)
S1(config)# interface g0/1 S1(config-if)# switchport mode access S1(config-if)# switchport access vlan 10 S1(config-if)# interface g0/2 S1(config-if)# switchport mode access S1(config-if)# switchport access vlan 30

HQ can't be built this way: the ISR4321 has no G0/0/2. It has two Gigabit ports, and one of them faces R2. That's the point. VLAN 30 would need a second router port, VLAN 99 a third. One door per department, and you run out of doors.

Module 4.2

Router-on-a-stick

One physical router interface, one cable, one trunk. The router splits its interface into subinterfaces, one per VLAN. Each subinterface is told which VLAN tag it answers to with encapsulation dot1Q, and each one gets the gateway address for that VLAN. Frames come up the trunk tagged, the router routes them, and sends them back down the same cable with the new VLAN's tag.

R1 · G0/0/1 .10 192.168.10.1 .30 192.168.30.1 .99 192.168.99.1 routes .10 → .30 tag 10 tag 30 one trunk cable S1 S2 F0/23 F0/1F0/11 PC-A · V10 PC-D · V30 Up the trunk tagged 10, back down the same cable tagged 30: every inter-VLAN packet crosses it twice.
Figure 1. Router-on-a-stick on HQ. PC-A (VLAN 10) to PC-D (VLAN 30). Each subinterface is a gateway; the tag decides which one a frame reaches.

The router side: one subinterface per VLAN

R1's physical port, G0/0/1, has no address of its own. Each subinterface gets its VLAN with encapsulation dot1Q, then that VLAN's gateway address. The native VLAN's subinterface, .900, gets the native keyword and no address, because nothing on VLAN 900 needs a gateway.

R1 · G0/0/1, one subinterface per VLAN
R1(config)# interface g0/0/1.10 R1(config-subif)# description VLAN 10 FRONT-DESK gateway ! ! Encapsulation first. IOS won't accept an IP address on a LAN subinterface without it. R1(config-subif)# encapsulation dot1Q 10 R1(config-subif)# ip address 192.168.10.1 255.255.255.0 R1(config-subif)# ipv6 address fe80::1 link-local R1(config-subif)# ipv6 address 2001:db8:acad:10::1/64 R1(config-subif)# exit ! R1(config)# interface g0/0/1.30 R1(config-subif)# description VLAN 30 LOGISTICS gateway R1(config-subif)# encapsulation dot1Q 30 ! ! VLAN 30 is the /26 from CCNA 1's VLSM plan, not a /24. R1(config-subif)# ip address 192.168.30.1 255.255.255.192 R1(config-subif)# ipv6 address fe80::1 link-local R1(config-subif)# ipv6 address 2001:db8:acad:30::1/64 R1(config-subif)# exit ! R1(config)# interface g0/0/1.99 R1(config-subif)# description VLAN 99 MGMT gateway R1(config-subif)# encapsulation dot1Q 99 R1(config-subif)# ip address 192.168.99.1 255.255.255.0 R1(config-subif)# ipv6 address fe80::1 link-local R1(config-subif)# ipv6 address 2001:db8:acad:99::1/64 R1(config-subif)# exit ! ! The native VLAN: untagged frames from the trunk land here. It gets no address. R1(config)# interface g0/0/1.900 R1(config-subif)# description Native VLAN 900 (no hosts) R1(config-subif)# encapsulation dot1Q 900 native R1(config-subif)# end R1# copy running-config startup-config

The switch side: a trunk to the router

S1 · G0/1, the trunk to R1
S1# configure terminal S1(config)# interface g0/1 S1(config-if)# description Trunk to R1 G0/0/1 S1(config-if)# switchport mode trunk S1(config-if)# switchport trunk native vlan 900 S1(config-if)# switchport trunk allowed vlan 10,30,99,900 ! ! A router never speaks DTP, so turn it off. S1(config-if)# switchport nonegotiate ! ! Optional tidy-up: the old access VLAN line stays in the config but does nothing on a trunk. S1(config-if)# no switchport access vlan S1(config-if)# end S1# copy running-config startup-config
Three rules for subinterfaces 1. encapsulation dot1Q comes before the IP address. IOS won't take an address on a subinterface until it knows the VLAN. 2. The subinterface number (.30) is just a label; the encapsulation dot1Q 30 line is what actually matches the tag. Making them match is a habit worth keeping, because a mismatch is an easy fault to miss (Door 1 in the Fault hunt). 3. The no shutdown that matters is on the physical interface. Subinterfaces follow it: shut G0/0/1, and every subinterface goes down with it.

Module 4.2

Verify router-on-a-stick

Check the router, check the trunk, then prove it with a ping that crosses VLANs.

R1: are the subinterfaces up?

R1 · interfaces
R1# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0/0 10.0.0.1 YES manual up up GigabitEthernet0/0/1 unassigned YES manual up up GigabitEthernet0/0/1.10 192.168.10.1 YES manual up up GigabitEthernet0/0/1.30 192.168.30.1 YES manual up up GigabitEthernet0/0/1.99 192.168.99.1 YES manual up up GigabitEthernet0/0/1.900 unassigned YES unset up up Loopback0 209.165.200.225 YES manual up up ...

R1: which VLAN is each subinterface really on?

R1 · the tag behind each subinterface
R1# show interfaces | include Gig|802.1Q GigabitEthernet0/0/0 is up, line protocol is up GigabitEthernet0/0/1 is up, line protocol is up GigabitEthernet0/0/1.10 is up, line protocol is up Encapsulation 802.1Q Virtual LAN, Vlan ID 10. GigabitEthernet0/0/1.30 is up, line protocol is up Encapsulation 802.1Q Virtual LAN, Vlan ID 30. GigabitEthernet0/0/1.99 is up, line protocol is up Encapsulation 802.1Q Virtual LAN, Vlan ID 99. GigabitEthernet0/0/1.900 is up, line protocol is up Encapsulation 802.1Q Virtual LAN, Vlan ID 900.

This is the command that catches a wrong VLAN number on a subinterface. show ip interface brief can't. If Packet Tracer doesn't accept the | filter, look at one at a time: show interfaces g0/0/1.30, and find the Encapsulation 802.1Q line.

S1: is the port to R1 a trunk?

S1 · trunks
S1# show interfaces trunk Port Mode Encapsulation Status Native vlan Fa0/23 on 802.1q trunking 900 Gig0/1 on 802.1q trunking 900 Port Vlans allowed on trunk Fa0/23 10,30,99,900 Gig0/1 10,30,99,900 Port Vlans allowed and active in management domain Fa0/23 10,30,99,900 Gig0/1 10,30,99,900 Port Vlans in spanning tree forwarding state and not pruned Fa0/23 10,30,99,900 Gig0/1 10,30,99,900

Gig0/1 is listed now. If the port to the router isn't in this output, it isn't a trunk, and no VLAN gets its gateway. Gig0/1 has also left show vlan brief, just as F0/23 did in Session 2.

R1: every subinterface is a real network

R1 · routing table
R1# show ip route ... Gateway of last resort is not set 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 10.0.0.0/30 is directly connected, GigabitEthernet0/0/0 L 10.0.0.1/32 is directly connected, GigabitEthernet0/0/0 192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.10.0/24 is directly connected, GigabitEthernet0/0/1.10 L 192.168.10.1/32 is directly connected, GigabitEthernet0/0/1.10 S 192.168.20.0/24 [1/0] via 10.0.0.2 192.168.30.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.30.0/26 is directly connected, GigabitEthernet0/0/1.30 L 192.168.30.1/32 is directly connected, GigabitEthernet0/0/1.30 192.168.99.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.99.0/24 is directly connected, GigabitEthernet0/0/1.99 L 192.168.99.1/32 is directly connected, GigabitEthernet0/0/1.99 209.165.200.0/24 is variably subnetted, 2 subnets, 2 masks C 209.165.200.224/27 is directly connected, Loopback0 L 209.165.200.225/32 is directly connected, Loopback0

Prove it: cross a VLAN

PC-A · VLAN 10 to VLAN 30
C:\> ping 192.168.30.9 Pinging 192.168.30.9 with 32 bytes of data: Reply from 192.168.30.9: bytes=32 time<1ms TTL=127 Reply from 192.168.30.9: bytes=32 time<1ms TTL=127 Reply from 192.168.30.9: bytes=32 time<1ms TTL=127 Reply from 192.168.30.9: bytes=32 time<1ms TTL=127

TTL=127, not 128. PC-D's reply started at 128 and crossed one router, which took one off. A same-VLAN reply (PC-A to PC-C) comes back at 128. The first ping may time out while R1 ARPs for PC-D.

PC-A · trace the route
C:\> tracert 192.168.30.9 Tracing route to 192.168.30.9 over a maximum of 30 hops: 1 0 ms 0 ms 0 ms 192.168.10.1 2 0 ms 0 ms 0 ms 192.168.30.9 Trace complete.

Hop 1 is PC-A's own gateway, the .10 subinterface. The packet goes up the trunk tagged 10, R1 routes it, and it comes back down the same cable tagged 30. Every inter-VLAN packet crosses that one cable twice. That's router-on-a-stick's limit in one picture.

Also testWhat it proves
PC-D → 192.168.30.1VLAN 30's gateway exists now
PC-D → www.it141.exampleVLAN 30 is routed off the HQ LAN, and DNS works
PC-A → ssh -l admin 192.168.99.11Session 2's cliffhanger is solved. VLAN 10 to VLAN 99 is routed now.
S1 → ping 192.168.10.10S1's default gateway, 192.168.99.1, finally exists
PC-A → ping PC-D's IPv6 address (read it from ipconfig on PC-D)IPv6 inter-VLAN routing, end to end

Module 4.3

Inter-VLAN routing on a Layer 3 switch

A Layer 3 switch can switch frames and route packets, in hardware. Give it one SVI (switch virtual interface, interface vlan N) per VLAN with that VLAN's gateway address, turn on ip routing, and it routes between its own VLANs without ever sending a packet to a router. To reach anything outside HQ, it still needs a link to R1. That link is a routed port: a switch port that stops being a switch port (no switchport) and behaves like a router interface with its own IP address.

CCNA 1 callback You've built SVIs before: every switch management address since CCNA 1 lives on one (interface vlan 1, now interface vlan 99). On a 2960, an SVI is only a way to manage the switch. On D1, an SVI is a real gateway, because D1 can route.
Router-on-a-stickLayer 3 switch
Gateway for VLAN 30R1 G0/0/1.30D1 interface vlan 30
Turn routing onIPv4 is on by default on a router; IPv6 still needs ipv6 unicast-routing (Session 1)ip routing (and ipv6 unicast-routing)
VLAN 10 → VLAN 30 pathUp the trunk to R1 and back downInside D1
Link to R1The trunk itselfA routed port, 10.0.0.8/30
SpeedLimited by one linkSwitch hardware speed
R1 routed port, no tags 10.0.0.8/30 · G1/0/24 D1 · ip routing Vlan10.10.1 Vlan30.30.1 Vlan99.99.1 routed inside D1 tag 10 tag 30 G1/0/1 trunk S1 S2 F0/23 F0/1F0/11 PC-A · V10 PC-D · V30
Figure 2. The same trip with D1 as the gateway. The addresses are the ones R1's subinterfaces had, but the routing now happens inside D1. Only traffic leaving HQ uses the routed port to R1.

D1's configuration

D1 needs five things: routing turned on, its own copy of the VLANs, a routed port to R1, a trunk to S1, and one SVI per VLAN.

D1 · routing on
D1# configure terminal ! ! A Layer 3 switch doesn't route IPv4 between its interfaces without this. D1(config)# ip routing ! ! And the IPv6 twin, as on R1 in Session 1. D1(config)# ipv6 unicast-routing
D1 · VLANs (the same as S1 and S2)
D1(config)# vlan 10 D1(config-vlan)# name FRONT-DESK D1(config-vlan)# vlan 30 D1(config-vlan)# name LOGISTICS D1(config-vlan)# vlan 99 D1(config-vlan)# name MGMT D1(config-vlan)# vlan 900 D1(config-vlan)# name NATIVE D1(config-vlan)# vlan 999 D1(config-vlan)# name PARKING D1(config-vlan)# exit

There's no VTP in this course, so D1 needs its own copy of every VLAN it uses. Remember: interface vlan 30 does not create VLAN 30.

D1 · G1/0/24, a routed port to R1
D1(config)# interface g1/0/24 D1(config-if)# description Routed link to R1 G0/0/1 ! ! Turns the Layer 2 switchport into a Layer 3 port, like a router interface. D1(config-if)# no switchport D1(config-if)# ip address 10.0.0.10 255.255.255.252 D1(config-if)# ipv6 address fe80::d1 link-local D1(config-if)# ipv6 address 2001:db8:acad:ff03::2/64 D1(config-if)# no shutdown D1(config-if)# end D1# ping 10.0.0.9
D1 · G1/0/1, the trunk to S1, and the parked ports
D1# configure terminal D1(config)# interface g1/0/1 D1(config-if)# description Trunk to S1 G0/1 ! ! PT's 3650 wants the encapsulation set before trunk mode. A 2960 has no such command. D1(config-if)# switchport trunk encapsulation dot1q D1(config-if)# switchport mode trunk D1(config-if)# switchport trunk native vlan 900 D1(config-if)# switchport trunk allowed vlan 10,30,99,900 D1(config-if)# switchport nonegotiate D1(config-if)# exit ! ! Everything not cabled yet. G1/0/2-4 and G1/0/20-21 get their jobs in Sessions 4, 5 and 10. D1(config)# interface range g1/0/2 - 23 , g1/1/1 - 4 D1(config-if-range)# switchport mode access D1(config-if-range)# switchport access vlan 999 D1(config-if-range)# shutdown D1(config-if-range)# end
The encapsulation line Session 2 promised this would come up. A switch that supports more than one trunk encapsulation needs switchport trunk encapsulation dot1q before switchport mode trunk. Packet Tracer's 3650 behaves that way: it rejects switchport mode trunk until the encapsulation is set. A 2960 has no such command, because it only does 802.1Q. On a real 3650, which also only does 802.1Q, the command may not exist at all. S1 needs no change: its trunk to R1 becomes its trunk to D1, with the same settings. Only the cable moves.
D1 · one SVI per VLAN
D1# configure terminal D1(config)# interface vlan 10 D1(config-if)# description VLAN 10 FRONT-DESK gateway D1(config-if)# ip address 192.168.10.1 255.255.255.0 D1(config-if)# ipv6 address fe80::1 link-local D1(config-if)# ipv6 address 2001:db8:acad:10::1/64 D1(config-if)# no shutdown D1(config-if)# exit ! D1(config)# interface vlan 30 D1(config-if)# description VLAN 30 LOGISTICS gateway D1(config-if)# ip address 192.168.30.1 255.255.255.192 D1(config-if)# ipv6 address fe80::1 link-local D1(config-if)# ipv6 address 2001:db8:acad:30::1/64 D1(config-if)# no shutdown D1(config-if)# exit ! D1(config)# interface vlan 99 D1(config-if)# description VLAN 99 MGMT gateway D1(config-if)# ip address 192.168.99.1 255.255.255.0 D1(config-if)# ipv6 address fe80::1 link-local D1(config-if)# ipv6 address 2001:db8:acad:99::1/64 D1(config-if)# no shutdown D1(config-if)# end

Moving the gateways from R1 to D1

When D1 takes over, R1 gives up its subinterfaces first, and D1 builds its SVIs second. The reason is R1's routing table. While R1 still has .10, .30 and .99 subinterfaces, it lists the HQ subnets as directly connected, and a connected route always beats the static routes that point at D1. R1's link to D1 becomes a plain routed port on a new /30:

R1 · remove the subinterfaces, readdress G0/0/1
R1# configure terminal R1(config)# no interface g0/0/1.10 R1(config)# no interface g0/0/1.30 R1(config)# no interface g0/0/1.99 R1(config)# no interface g0/0/1.900 ! R1(config)# interface g0/0/1 R1(config-if)# description Routed link to D1 G1/0/24 R1(config-if)# ip address 10.0.0.9 255.255.255.252 R1(config-if)# ipv6 address fe80::1 link-local R1(config-if)# ipv6 address 2001:db8:acad:ff03::1/64 R1(config-if)# no shutdown R1(config-if)# end

On real routers, a deleted subinterface may linger in show ip interface brief as deleted until the next reload. Its configuration is gone.

Beyond Module 4: static routes R1 and D1 also need routes to each other's networks: R1 to the HQ subnets behind D1, and D1 to everything outside HQ. Those are static routes, which are Module 15 (Session 11). Here they're provided.
R1 · the HQ networks are behind D1
R1# configure terminal R1(config)# ip route 192.168.10.0 255.255.255.0 10.0.0.10 ! ! The /26 mask, not /24. R1(config)# ip route 192.168.30.0 255.255.255.192 10.0.0.10 R1(config)# ip route 192.168.99.0 255.255.255.0 10.0.0.10 R1(config)# ipv6 route 2001:db8:acad:10::/64 2001:db8:acad:ff03::2 R1(config)# ipv6 route 2001:db8:acad:30::/64 2001:db8:acad:ff03::2 R1(config)# ipv6 route 2001:db8:acad:99::/64 2001:db8:acad:ff03::2 R1(config)# end R1# copy running-config startup-config
D1 · everything else is through R1
D1# configure terminal D1(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.9 D1(config)# ipv6 route ::/0 2001:db8:acad:ff03::1 D1(config)# end D1# copy running-config startup-config

R2 needs nothing. Its default route already sends every HQ-bound packet to R1, and R1 now knows the way to D1.

Same address, new box Hosts may still have R1's MAC address cached for 192.168.10.1: the address didn't change, but the device behind it did. Real devices usually fix this themselves, because a new SVI announces itself with a gratuitous ARP. If a ping to the gateway fails right after a change like this, arp -d on the PC clears the cache.
Coming up in CCNA 3 Here R1 and D1 learn each other's networks from typed-in static routes. Larger networks use a routing protocol such as OSPF instead, so routers and Layer 3 switches share their routes automatically. Session 11 introduces the idea; CCNA 3 configures OSPF.

Module 4.3

Verify the Layer 3 switch

The proof that D1 has taken over is a traceroute: the first hop is the same address as with router-on-a-stick, but now it's D1 answering.

D1: are the SVIs up?

D1 · interfaces (trimmed)
D1# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet1/0/1 unassigned YES unset up up GigabitEthernet1/0/2 unassigned YES unset administratively down down ... GigabitEthernet1/0/24 10.0.0.10 YES manual up up ... Vlan10 192.168.10.1 YES manual up up Vlan30 192.168.30.1 YES manual up up Vlan99 192.168.99.1 YES manual up up

All three SVIs up/up is the success check. up down means the VLAN doesn't exist on D1, or no active port carries it. administratively down means a forgotten no shutdown. The full output lists every one of D1's 28 ports; it's trimmed here.

D1: the routing table

D1 · routes
D1# show ip route ... Gateway of last resort is 10.0.0.9 to network 0.0.0.0 10.0.0.0/30 is subnetted, 1 subnets C 10.0.0.8 is directly connected, GigabitEthernet1/0/24 C 192.168.10.0/24 is directly connected, Vlan10 192.168.30.0/26 is subnetted, 1 subnets C 192.168.30.0 is directly connected, Vlan30 C 192.168.99.0/24 is directly connected, Vlan99 S* 0.0.0.0/0 [1/0] via 10.0.0.9

The gateway moved. The trace didn't.

PC-A · trace to PC-D, through D1
C:\> tracert 192.168.30.9 Tracing route to 192.168.30.9 over a maximum of 30 hops: 1 0 ms 0 ms 0 ms 192.168.10.1 2 0 ms 0 ms 0 ms 192.168.30.9 Trace complete.

Identical to the router-on-a-stick trace. Hop 1 is still 192.168.10.1, but now it's D1's Vlan10 SVI answering, not R1. The packet never leaves the HQ switches: S1 to D1, routed inside D1, then back down to S1, across to S2, and out to PC-D. What changed? The box, not the address.

PC-A · trace to SRV1, through D1
C:\> tracert 192.168.20.100 Tracing route to 192.168.20.100 over a maximum of 30 hops: 1 0 ms 0 ms 0 ms 192.168.10.1 2 0 ms 0 ms 0 ms 10.0.0.9 3 0 ms 0 ms 0 ms 10.0.0.2 4 0 ms 0 ms 0 ms 192.168.20.100 Trace complete.

One more hop than with router-on-a-stick: D1, then R1 (answering from 10.0.0.9, its end of the new link), then R2, then SRV1. Each router answers from the interface the trace arrived on.

Also testWhat it proves
D1 → ping 192.168.20.100D1's default route out, and R2's default route back
PC-D → www.it141.exampleVLAN 30 through D1, R1 and R2
PC-A → ssh -l admin 192.168.10.1The prompt says D1>, not R1. Same address, new box.
PC-A → ssh -l admin 192.168.99.11Management is still reachable, now through D1
PC-B → ping 192.168.30.9The Shipping site reaches HQ: R2's default route, R1's static route, then D1

Drill

Which door?

The most common inter-VLAN routing mistake isn't a command. It's a host, or a switch, pointed at the wrong gateway. Pick the right one.

Drill · Which door?

A device on today's network needs its default gateway set. Which address is right?

Module 4.4

Troubleshoot inter-VLAN routing

Work from the host outward: the host's own settings, its access port, the trunk, then the router or Layer 3 switch. Every fault below breaks something specific, and one command shows it.

FaultSymptomThe command that shows itFix
1 · Wrong host gateway
(PC-A gateway 192.168.10.254)
PC-A reaches PC-C but nothing outside its subnetipconfig on the PCSet the gateway to its VLAN's .1
2 · Gateway set to another VLAN's door
(PC-D gateway 192.168.10.1)
PC-D reaches nothing outside 192.168.30.0/26. It can ping 192.168.30.1, which fools people: that's on its own subnet, so the gateway isn't used.ipconfig: the gateway isn't inside PC-D's own subnet192.168.30.1. A gateway must be inside the host's own subnet.
3 · Subinterface VLAN mismatch
(.30 has encapsulation dot1Q 3)
VLAN 30 can't reach its gateway. show ip interface brief shows everything up/up.show interfaces g0/0/1.30: the Vlan ID is wrongno encapsulation dot1Q, then the right one, then re-enter the addresses: changing the encapsulation wipes them
4 · The switch port to the router isn't a trunkEvery VLAN loses its gateway, even VLAN 10. Untagged frames all land on .900.show interfaces trunk on S1: Gig0/1 is missingswitchport mode trunk, native 900, the allowed list, nonegotiate
5 · VLAN left off the allowed listOnly that VLAN fails. On the Layer 3 switch, if D1's trunk is the one missing it, that VLAN's SVI on D1 also goes up/down.show interfaces trunk: the VLAN is missing from "allowed"switchport trunk allowed vlan add 30
6 · ip routing missing on D1Each host can ping its own gateway, but nothing crosses between VLANsshow ip route on D1: no C routesip routing (and ipv6 unicast-routing for IPv6)
7 · SVI down: the VLAN doesn't exist on D1, or no active port carries itThat VLAN's hosts can't reach .1show ip interface brief: Vlan30 up/down. show vlan brief on D1: no VLAN 30.Create the VLAN. Make sure the trunk is up and carries it.
8 · Routed port left as a switch portD1 can't ping 10.0.0.9; nothing leaves HQ. The ip address command was rejected when typed.show ip interface brief: G1/0/24 unassignedno switchport, then the addresses again
9 · Physical interface shut (R1 G0/0/1)Every HQ VLAN loses its gateway at onceshow ip interface brief: G0/0/1 administratively down, and every subinterface down with itno shutdown on the physical interface
10 · Old address left on the physical port (R1 G0/0/1 still 192.168.10.1)The .10 subinterface's address was rejected as overlapping, so VLAN 10 has no gateway. VLANs 30 and 99 are fine.show ip interface brief: G0/0/1 still has 192.168.10.1, and .10 is unassignedno ip address and no ipv6 address on G0/0/1, then the addresses on .10
Read the pattern Which VLANs are broken tells you where to look. One VLAN broken: that VLAN's subinterface or SVI, its allowed-list entry, or one host. Every VLAN broken: the shared piece, which is the trunk to the router, the router's physical port, or ip routing. One host broken while its neighbors work: that host's settings or its access port.

The Wrong Door

Fault hunt

Each config below has one bug. Find it before you open the answer. Each one is a fault from the Troubleshoot table.

THREAT LEVEL: GATEWAY

CASE FILE D-03

The Wrong Door

Never touches a cable. It points a host, or a switch, at the wrong gateway: another VLAN's address, an address outside the host's own subnet, or the right address on an SVI that's down. The host still reaches its neighbors, so everything looks fine until it tries to leave.

Tell: ipconfig shows a default gateway outside the host's own subnet, or show ip interface brief shows the gateway's SVI or subinterface as anything but up up. Pings inside the VLAN work, and anything routed fails.

See also: Why VLANs need a router · Which door?

Debrief PC-D, with gateway 192.168.10.1, can still ping 192.168.30.1. Why doesn't that prove its gateway works? (192.168.30.1 is in PC-D's own subnet, so that ping never uses the gateway. Only a ping to another subnet tests it)

Door 1

Symptom: With router-on-a-stick, PC-D (VLAN 30) can't ping 192.168.30.1. VLANs 10 and 99 work. R1's show ip interface brief shows every subinterface up/up.

R1 · show running-config (part)
R1# show running-config ... interface GigabitEthernet0/0/1.10 encapsulation dot1Q 10 ip address 192.168.10.1 255.255.255.0 interface GigabitEthernet0/0/1.30 encapsulation dot1Q 3 ip address 192.168.30.1 255.255.255.192 interface GigabitEthernet0/0/1.99 encapsulation dot1Q 99 ip address 192.168.99.1 255.255.255.0

Door 2

Symptom: With router-on-a-stick, nobody at HQ can reach their gateway, not even VLAN 10, which worked all through Session 2.

S1 · show running-config interface g0/1
S1# show running-config interface g0/1 interface GigabitEthernet0/1 description Trunk to R1 G0/0/1 switchport access vlan 10 switchport mode access

Door 3

Symptom: After D1 takes over, PC-A reaches 192.168.10.1 and PC-C. PC-D reaches 192.168.30.1. But PC-A can't ping PC-D, and nobody reaches SRV1.

D1 · what routing is on?
D1# show running-config | include routing ipv6 unicast-routing

Door 4

Symptom: After D1 takes over, PC-A and PC-D can ping each other, but nobody at HQ reaches SRV1. D1 can't ping 10.0.0.9.

D1 · show running-config interface g1/0/24
D1# show running-config interface g1/0/24 interface GigabitEthernet1/0/24 description Routed link to R1 G0/0/1

End of session

What works now, and what doesn't

HQ at the end of the session, with D1 routing.

From → ToResultWhy
PC-A ↔ PC-D (VLAN 10 ↔ VLAN 30)WorksD1 routes between its SVIs
PC-A → S1 or S2 (SSH 192.168.99.11 / .12)WorksSession 2's cliffhanger is closed. The switches' gateway, .99.1, is D1.
PC-A → ssh 192.168.10.1Reaches D1Same address, new box
Any HQ PC → SRV1, www.it141.example, PC-B, S3WorksD1 → R1 → R2
PC-B → any HQ hostWorksR2's default route → R1's static route → D1
IPv6: PC-A ↔ PC-D, HQ → SRV1Worksipv6 unicast-routing on D1, plus the provided IPv6 routes
S1 or S2 over IPv6NoThe 2960 SVIs are still IPv4-only
DHCP for anyoneNoStatic addresses only. DHCPv4 arrives in Session 6.
HQ if S1 G0/1 failsAll of HQ is cut offS1 G0/1 is D1's only link to the access switches. S2 reaches D1 only through S1.
Coming up in Session 4: a second hallway Right now S2 reaches D1 only through S1. If the S1–S2 trunk fails, S2's whole floor is cut off. Next session adds a cable from S2 straight to D1. That makes a triangle, and a triangle of switches is a loop. Module 5 is about the protocol that keeps a loop from flooding the building.

Recurring segment

The Ticket

Turn it into steps before you open the answer.

Ticket #141-03 · Priority: medium · From: Logistics

Since the new switch went in, PC-D can print to the shared printer in our own office, but it can't get to anything at Front Desk or the website. Nobody touched PC-D. Somebody said "the gateway" but we don't know what that means.

One way to break it down
  1. "Can reach our own office": same-VLAN traffic works, so PC-D's access port, its VLAN, and its address and mask are probably fine. The problem is anything that needs a gateway.
  2. Check PC-D's settings first: ipconfig. The gateway must be 192.168.30.1, and the mask must be /26 (255.255.255.192). A gateway of 192.168.10.1 is the wrong door, and it's outside PC-D's subnet, so PC-D can't reach it at all.
  3. If the PC is right, check the door itself on D1: show ip interface brief | include Vlan30. It should be up up with 192.168.30.1. If it's down, check that VLAN 30 exists on D1 (show vlan brief) and that it crosses the D1–S1 trunk and the S1–S2 trunk (show interfaces trunk, "allowed and active").
  4. "Nobody touched PC-D" while "the new switch went in" points at D1, not the PC. Did ip routing make it into D1's config? Without it, D1 won't route between the VLANs at all.
  5. Verify: from PC-D, ping 192.168.30.1, then ping 192.168.10.10 (PC-A), then tracert 192.168.20.100 (SRV1). The first hop should be 192.168.30.1.

Before Session 4

Checkpoint: Module 4

If you can do these cold, you're ready for the module-group exam on Modules 1–4.

Study

Flashcards

Click to flip. Double-click to mark as known.

Check yourself

Sample questions

Pick an answer to see if you're right. Same style as the module-group exam.

Applied

Worked examples

Think it through before you expand the answer.

Gateways

Same subnet, wrong door

PC-D (192.168.30.9/26) has its gateway set to 192.168.30.62. It can ping PC-D's neighbors in VLAN 30, but nothing else. Its address and mask are right. What's wrong, and why doesn't the PC complain?

Show answer

192.168.30.62 is inside PC-D's subnet (usable .1–.62), so nothing about the setting looks wrong. But nothing owns that address: the gateway is 192.168.30.1. PC-D ARPs for .62, nobody answers, and every packet for another network goes nowhere. A host doesn't check that its gateway is the right address, or that anything owns it. Fix: set the gateway to 192.168.30.1.

Subinterfaces

The number that doesn't matter

A classmate configures interface g0/0/1.30 with encapsulation dot1Q 10 and ip address 192.168.30.1 255.255.255.192. Their g0/0/1.10 is correct. What breaks?

Show answer

On a real router, IOS refuses encapsulation dot1Q 10 on .30, because VLAN 10 already belongs to .10. Then the ip address line is refused too, because .30 has no encapsulation. Packet Tracer may accept both; check. Either way, nothing answers for VLAN 30's tag, so PC-D can't reach 192.168.30.1. The .30 in the name is only a label. The encapsulation dot1Q line is what matters. show interfaces g0/0/1.30, or show running-config, shows which subinterface has which VLAN.

Layer 3 switch

Everything's up, nothing routes

On D1, show ip interface brief shows Vlan10, Vlan30 and Vlan99 all up/up with the right addresses. PC-A can ping 192.168.10.1, and PC-D can ping 192.168.30.1. But PC-A can't ping PC-D. What did someone forget?

Show answer

ip routing. Without it, a Layer 3 switch answers on each SVI like a host would, but it won't forward packets between them. show ip route is the giveaway: without ip routing there are no C routes for the SVIs. Real IOS prints a short "Default gateway is not set" table instead. Turn it on in global config.

Routed ports

The port that wouldn't take an address

On D1, interface g1/0/24, then ip address 10.0.0.10 255.255.255.252, gives an error. Why?

Show answer

It's still a switch port, and switch ports don't have IP addresses: they belong to a VLAN. Run no switchport first to make it a routed port, then add the address.

The swap

Why didn't the PCs notice?

When D1 took over from R1, nobody changed a single setting on PC-A, PC-C or PC-D. Explain why they still work, and why a ping right after the swap might fail once.

Show answer

The hosts only know their gateway's IP address, and D1's SVIs use the same addresses R1's subinterfaces used. What changed is the MAC address behind that IP. A host that cached R1's MAC for 192.168.10.1 keeps sending to it until the ARP entry times out or is cleared. That's why the first pings can fail, and why arp -d on the PC fixes it straight away.

Reference

Glossary & index

Every term from this session. Search, or jump by letter.