Lab – Configuring Per-Interface Inter-VLAN Routing

Topology

Addressing Table

Device

Interface

IP Address

Subnet Mask

Default Gateway

R1

fa0/0

192.168.20.1

255.255.255.0

N/A

fa0/1

192.168.10.1

255.255.255.0

N/A

S1

VLAN 10

192.168.10.11

255.255.255.0

192.168.10.1

S2

VLAN 10

192.168.10.12

255.255.255.0

192.168.10.1

PC-A

NIC

192.168.10.3

255.255.255.0

192.168.10.1

PC-B

NIC

192.168.20.3

255.255.255.0

192.168.20.1

Step 1: Configure basic settings on PC-A and PC-B.

PC-A>ipconfig

FastEthernet0 Connection:(default port)

   Link-local IPv6 Address.........: FE80::260:47FF:FE20:495C
   IP Address......................: 192.168.10.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.10.1

PC-A>
PC-B>ipconfig

FastEthernet0 Connection:(default port)

   Link-local IPv6 Address.........: FE80::203:E4FF:FE6B:EC3
   IP Address......................: 192.168.20.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.20.1

PC-B>

Step 2: Configure VLANs on S1.

  • On S1, create VLAN 10. Assign Student as the VLAN name.

  • Create VLAN 20. Assign Faculty-Admin as the VLAN name.

  • Configure F0/1 as a trunk port.

  • Assign ports F0/5 and F0/6 to VLAN 10 and configure both F0/5 and F0/6 as access ports.

  • Assign an IP address to VLAN 10 and enable it. Refer to the Addressing Table.

  • Configure the default gateway according to the Addressing Table.

Switch>enable
Switch#configure terminal 
Switch(config)#hostname S1
S1(config)#vlan 10
S1(config-vlan)#name Student
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#name Faculty-Admin
S1(config-vlan)#exit
S1(config)#inter
S1(config)#interface fa0/1
S1(config-if)#switchport mode trunk 
S1(config-if)#exit
S1(config)#inter
S1(config)#interface range fa0/5-6
S1(config-if-range)#switchport mode access 
S1(config-if-range)#switchport access vlan 10
S1(config-if-range)#exit
S1(config)#interface vlan 10
S1(config-if)#ip address 192.168.10.11 255.255.255.0
S1(config-if)#no shut
S1(config-if)#exit
S1(config)#ip default-gateway 192.168.10.1

Step 3: Configure VLANs on S2.

  • On S2, create VLAN 10. Assign Student as the VLAN name.

  • Create VLAN 20. Assign Faculty-Admin as the VLAN name.

  • Configure F0/1 as a trunk port.

  • Assign ports F0/11 and F0/18 to VLAN 20 and configure both F0/11 and F0/18 as access ports.

  • Assign an IP address to VLAN 10 and enable it. Refer to the Addressing Table.

  • Configure the default gateway according to the Addressing Table.

Switch>enable
Switch#configure terminal 
Switch(config)#hostname S2
S2(config)#vlan 10
S2(config-vlan)#name Student
S2(config-vlan)#exit
S2(config)#vlan 20
S2(config-vlan)#name Faculty-Admin
S2(config-vlan)#exit
S2(config)#inter
S2(config)#interface range fa0/11-18
S2(config-if-range)#switchport mode access 
S2(config-if-range)#switchport access vlan 
S2(config-if-range)#exit
S2(config)#interface range fa0/11,fa0/18
S2(config-if-range)#switchport mode access 
S2(config-if-range)#switchport access vlan 20
S2(config-if-range)#exit
S2(config-if)#switchport mode trunk 
S2(config-if)#exit
S2(config)#interface vlan 10
S2(config-if)#ip address 192.168.10.12 255.255.255.0
S2(config-if)#no shut
S2(config-if)#exit
S2(config)#ip default-gateway 192.168.20.1

Step 4: Configure basic settings for R1.

Router>enable 
Router#configure terminal 
Router(config)#interface fa0/1
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#interface fa0/0
Router(config-if)#ip add 192.168.20.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#

Step 5: Verify Trunking, VLANs, Routing, and Connectivity

Task 1: On R1, issue the show ip route command. What routes are listed on R1?

Router#show ip route 
....

Gateway of last resort is not set

C    192.168.10.0/24 is directly connected, FastEthernet0/1
C    192.168.20.0/24 is directly connected, FastEthernet0/0
Router#

Task 2: On both S1 and S2, issue the show interface trunk command. Is the F0/1 port on both switches set to trunk?

S1#show interfaces trunk 
Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1

Port        Vlans allowed on trunk
Fa0/1       1-1005

Port        Vlans allowed and active in management domain
Fa0/1       1,10,20

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1,10,20
S1#
S2#show interfaces trunk 
Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1

Port        Vlans allowed on trunk
Fa0/1       1-1005

Port        Vlans allowed and active in management domain
Fa0/1       1,10,20

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1,10,20
S2#

Task 3: Issue a show vlan brief command on both S1 and S2. Verify that VLANs 10 and 20 are active and that the proper ports on the switches are in the correct VLANs. Why is F0/1 not listed in any of the active VLANs?

S1#show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13, Fa0/14, Fa0/15
                                                Fa0/16, Fa0/17, Fa0/18, Fa0/19
                                                Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24, Gig0/1, Gig0/2
10   Student                          active    Fa0/5, Fa0/6
20   Faculty-Admin                    active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    
S1#
S2#show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/12, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/19
                                                Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24, Gig0/1, Gig0/2
10   Student                          active    
20   Faculty-Admin                    active    Fa0/11, Fa0/18
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    
S2#

Task 4: Ping from PC-A in VLAN 10 to PC-B in VLAN 20. If Inter-VLAN routing is functioning correctly, the pings between the 192.168.10.0 network and the 192.168.20.0 should be successful.

PC-A>ping 192.168.10.3

Pinging 192.168.10.3 with 32 bytes of data:

Reply from 192.168.10.3: bytes=32 time=1ms TTL=127
Reply from 192.168.10.3: bytes=32 time=0ms TTL=127
Reply from 192.168.10.3: bytes=32 time=0ms TTL=127
Reply from 192.168.10.3: bytes=32 time=0ms TTL=127

Ping statistics for 192.168.10.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC-A>
PC-B>ping 192.168.10.3

Pinging 192.168.10.3 with 32 bytes of data:

Reply from 192.168.10.3: bytes=32 time=1ms TTL=127
Reply from 192.168.10.3: bytes=32 time=0ms TTL=127
Reply from 192.168.10.3: bytes=32 time=0ms TTL=127
Reply from 192.168.10.3: bytes=32 time=0ms TTL=127

Ping statistics for 192.168.10.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC-B>

Keywords

inter-vlan routing , Per-Interface Inter-VLAN Routing , topology , interface , ip address , subnet mask , default gateway , vlan , trunk port , default gateway , show ip route , encapsulation , native vlan

Last updated