PG1X WIKI

My Knowledge Base

User Tools

Site Tools


tech:network:inter-vlan-routing-router-on-a-stick:inter-vlan-routing-router-on-a-stick

Inter-VLAN Routing: Router-on-a-stick

Inter-VLAN Routing using Router, it's called also “Router on a stick”.
not Inter-VLAN Routing means Layer3 Switching only.

Lab5-1

Configuration

  • R1
en
conf t
int f0/0.1
encapsulation dot1q 1 native
ip addr 172.16.1.254 255.255.255.0
int f0/0.2
encapsulation dot1q 2
ip addr 172.16.2.254 255.255.255.0
int f0/0.3
encapsulation dot1q 3
ip addr 172.16.3.254 255.255.255.0
int f0/0
no shut
!
end
  • DSW1
en
conf t
vtp mode transparent
vlan 1-3
exit
! shutdown unnecessary ports
int f1/0/4
shut
int f1/0/6
shut
int f1/0/8
shut
int f1/0/24
shut
!
int f1/0/1
switchport trunk encapsulation dot1q
switchport mode trunk
! not required
switchport nonegotiate
int f1/0/11
switchport mode access
switchport access vlan 1
int f1/0/12
switchport mode access
switchport access vlan 2
int f1/0/13
switchport mode access
switchport access vlan 3
!
end

no router, no switch configuration

Wiring only.

ping 172.16.1.1 -c2
ping 172.16.2.1 -c2
ping 172.16.3.1 -c2
ping 172.16.1.254 -c2
ping 172.16.2.254 -c2
ping 172.16.3.254 -c2
DSW1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
DSW1(config)#int f1/0/4
DSW1(config-if)#shut
DSW1(config-if)#int f1/0/6
DSW1(config-if)#shut
DSW1(config-if)#int f1/0/8
DSW1(config-if)#shut
DSW1(config-if)#int f1/0/24
DSW1(config-if)#shut
DSW1(config-if)#^Z
DSW1#
*Mar  1 08:14:54.522: %SYS-5-CONFIG_I: Configured from console by console
*Mar  1 08:14:54.589: %LINK-5-CHANGED: Interface FastEthernet1/0/4, changed state to administratively down
*Mar  1 08:14:54.606: %LINK-5-CHANGED: Interface FastEthernet1/0/6, changed state to administratively down
*Mar  1 08:14:54.639: %LINK-5-CHANGED: Interface FastEthernet1/0/8, changed state to administratively down
*Mar  1 08:14:54.639: %LINK-5-CHANGED: Interface FastEthernet1/0/24, changed state to administratively down
DSW1#
*Mar  1 08:14:55.595: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/4, changed state to down
*Mar  1 08:14:55.612: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/6, changed state to down
*Mar  1 08:14:55.646: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/8, changed state to down

on Pi0

pi@raspberrypi:~ $ ping 172.16.1.1 -c2
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=64 time=0.172 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=64 time=0.110 ms

--- 172.16.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.110/0.141/0.172/0.031 ms
pi@raspberrypi:~ $ ping 172.16.2.1 -c2
PING 172.16.2.1 (172.16.2.1) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.3.1 -c2
PING 172.16.3.1 (172.16.3.1) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.3.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1005ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.1.254 -c2
PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.1.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1004ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.3.254 -c2
PING 172.16.3.254 (172.16.3.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.3.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1002ms
pipe 2

no router

switch configured.

ping 172.16.1.1 -c2
ping 172.16.2.1 -c2
ping 172.16.3.1 -c2
ping 172.16.1.254 -c2
ping 172.16.2.254 -c2
ping 172.16.3.254 -c2
sh vlan brief
sh int f1/0/1 trunk
sh int f1/0/1 switchport
DSW1#sh vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0/1, Fa1/0/2, Fa1/0/3
                                                Fa1/0/4, Fa1/0/5, Fa1/0/6
                                                Fa1/0/7, Fa1/0/8, Fa1/0/9
                                                Fa1/0/10, Fa1/0/11, Fa1/0/14
                                                Fa1/0/15, Fa1/0/16, Fa1/0/17
                                                Fa1/0/18, Fa1/0/19, Fa1/0/20
                                                Fa1/0/21, Fa1/0/22, Fa1/0/23
                                                Fa1/0/24, Gi1/0/1, Gi1/0/2
2    VLAN0002                         active    Fa1/0/12
3    VLAN0003                         active    Fa1/0/13
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
DSW1#sh int f1/0/1 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/1     on               802.1q         other         1

Port        Vlans allowed on trunk
Fa1/0/1     none

Port        Vlans allowed and active in management domain
Fa1/0/1     none

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/1     none
DSW1#sh int f1/0/1 switchport
Name: Fa1/0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

still ping failing, because of no router link active.

on Pi0

pi@raspberrypi:~ $ ping 172.16.1.1 -c2
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=64 time=0.172 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=64 time=0.105 ms

--- 172.16.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.105/0.138/0.172/0.035 ms
pi@raspberrypi:~ $ ping 172.16.2.1 -c2
PING 172.16.2.1 (172.16.2.1) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1005ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.3.1 -c2
PING 172.16.3.1 (172.16.3.1) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.3.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1002ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.1.254 -c2
PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.1.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.3.254 -c2
PING 172.16.3.254 (172.16.3.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.3.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1003ms
pipe 2

router sub-interface configuration but physical interface not configured

configured except router interface no shut

en
conf t
int f0/0.1
encapsulation dot1q 1 native
ip addr 172.16.1.254 255.255.255.0
int f0/0.2
encapsulation dot1q 2
ip addr 172.16.2.254 255.255.255.0
int f0/0.3
encapsulation dot1q 3
ip addr 172.16.3.254 255.255.255.0
!
end
ping 172.16.1.1 -c2
ping 172.16.2.1 -c2
ping 172.16.3.1 -c2
ping 172.16.1.254 -c2
ping 172.16.2.254 -c2
ping 172.16.3.254 -c2
sh run | be 0/0
sh ip int b
sh ip ro
sh int f1/0/1 trunk
sh int f1/0/1 switchport
R1#sh run | be 0/0
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 172.16.1.254 255.255.255.0
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 172.16.2.254 255.255.255.0
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 172.16.3.254 255.255.255.0
!
R1#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES NVRAM  administratively down down
FastEthernet0/0.1          172.16.1.254    YES manual administratively down down
FastEthernet0/0.2          172.16.2.254    YES manual administratively down down
FastEthernet0/0.3          172.16.3.254    YES manual administratively down down
FastEthernet0/1            unassigned      YES NVRAM  administratively down down
Serial0/0/0                unassigned      YES NVRAM  administratively down down
DSW1#sh int f1/0/1 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/1     on               802.1q         other         1

Port        Vlans allowed on trunk
Fa1/0/1     none

Port        Vlans allowed and active in management domain
Fa1/0/1     none

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/1     none
DSW1#sh int f1/0/1 switchport
Name: Fa1/0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

still ping failing. even default gateway ip, because of R1 f0/0 physical interface shutdown.

pi@raspberrypi:~ $ ping 172.16.1.1 -c2
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=64 time=0.174 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=64 time=0.089 ms

--- 172.16.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.089/0.131/0.174/0.044 ms
pi@raspberrypi:~ $ ping 172.16.2.1 -c2
PING 172.16.2.1 (172.16.2.1) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.3.1 -c2
PING 172.16.3.1 (172.16.3.1) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.3.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1005ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.1.254 -c2
PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.1.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1004ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1004ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.3.254 -c2
PING 172.16.3.254 (172.16.3.254) 56(84) bytes of data.
From 172.16.1.1 icmp_seq=1 Destination Host Unreachable
From 172.16.1.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.3.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1000ms
pipe 2

router sub-interface configuration correctly

finally, configure all correctly. let's no shut R1 f0/0!

en
conf t
int f0/0
no shut
!
end
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/0
R1(config-if)#no shut
R1(config-if)#!
R1(config-if)#end
R1#
*Mar 18 06:02:05.867: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Mar 18 06:02:11.407: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1#

wait STP timer.

DSW1#
*Mar  1 08:26:26.674: %LINK-3-UPDOWN: Interface FastEthernet1/0/1, changed state to up
*Mar  1 08:26:27.681: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to up
DSW1#
ping 172.16.1.1 -c2
ping 172.16.2.1 -c2
ping 172.16.3.1 -c2
ping 172.16.1.254 -c2
ping 172.16.2.254 -c2
ping 172.16.3.254 -c2
traceroute -n 172.16.2.1
sh run | be 0/0
sh ip int b
sh ip ro
sh int f1/0/1 trunk
sh int f1/0/1 switchport

now f0/0 physical interface up/up and sub-interface up/up.

R1#sh run | be 0/0
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 172.16.1.254 255.255.255.0
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 172.16.2.254 255.255.255.0
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 172.16.3.254 255.255.255.0
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
R1#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES NVRAM  up                    up
FastEthernet0/0.1          172.16.1.254    YES manual up                    up
FastEthernet0/0.2          172.16.2.254    YES manual up                    up
FastEthernet0/0.3          172.16.3.254    YES manual up                    up
FastEthernet0/1            unassigned      YES NVRAM  administratively down down
Serial0/0/0                unassigned      YES NVRAM  administratively down down

Trunk port operational.

DSW1#sh int f1/0/1 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/1     on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa1/0/1     1-4094

Port        Vlans allowed and active in management domain
Fa1/0/1     1-3

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/1     1-3
DSW1#sh int f1/0/1 switchport
Name: Fa1/0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Inter-VLAN Routing works.

pi@raspberrypi:~ $ ping 172.16.1.1 -c2
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=64 time=0.159 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=64 time=0.129 ms

--- 172.16.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.129/0.144/0.159/0.015 ms
pi@raspberrypi:~ $ ping 172.16.2.1 -c2
PING 172.16.2.1 (172.16.2.1) 56(84) bytes of data.
64 bytes from 172.16.2.1: icmp_seq=1 ttl=63 time=5.89 ms
64 bytes from 172.16.2.1: icmp_seq=2 ttl=63 time=0.733 ms

--- 172.16.2.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.733/3.313/5.894/2.581 ms
pi@raspberrypi:~ $ ping 172.16.3.1 -c2
PING 172.16.3.1 (172.16.3.1) 56(84) bytes of data.
64 bytes from 172.16.3.1: icmp_seq=1 ttl=63 time=3.00 ms
64 bytes from 172.16.3.1: icmp_seq=2 ttl=63 time=0.722 ms

--- 172.16.3.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.722/1.862/3.002/1.140 ms
pi@raspberrypi:~ $ ping 172.16.1.254 -c2
PING 172.16.1.254 (172.16.1.254) 56(84) bytes of data.
64 bytes from 172.16.1.254: icmp_seq=1 ttl=255 time=0.990 ms
64 bytes from 172.16.1.254: icmp_seq=2 ttl=255 time=0.961 ms

--- 172.16.1.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.961/0.975/0.990/0.034 ms
pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
64 bytes from 172.16.2.254: icmp_seq=1 ttl=255 time=1.05 ms
64 bytes from 172.16.2.254: icmp_seq=2 ttl=255 time=1.01 ms

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.014/1.036/1.058/0.022 ms
pi@raspberrypi:~ $ ping 172.16.3.254 -c2
PING 172.16.3.254 (172.16.3.254) 56(84) bytes of data.
64 bytes from 172.16.3.254: icmp_seq=1 ttl=255 time=0.941 ms
64 bytes from 172.16.3.254: icmp_seq=2 ttl=255 time=0.947 ms

--- 172.16.3.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.941/0.944/0.947/0.003 ms
pi@raspberrypi:~ $ traceroute -n 172.16.2.1
traceroute to 172.16.2.1 (172.16.2.1), 30 hops max, 60 byte packets
 1  172.16.1.254  1.557 ms  2.076 ms  2.497 ms
 2  172.16.2.1  1.267 ms  1.419 ms  1.463 ms

Lab5-2

Configuration

  • R1
en
conf t
int f0/0.1
encapsulation dot1q 1 native
ip addr 172.16.1.254 255.255.255.0
int f0/0.2
encapsulation dot1q 2
ip addr 172.16.2.254 255.255.255.0
int f0/0.3
encapsulation dot1q 3
ip addr 172.16.3.254 255.255.255.0
int f0/0
no shut
!
end
  • DSW1
en
conf t
vtp mode transparent
vlan 1-4
exit
! shutdown unnecessary ports
int f1/0/4
shut
int f1/0/24
shut
!
int f1/0/1
switchport trunk encapsulation dot1q
switchport mode trunk
! not required
switchport nonegotiate
int f1/0/6
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate
int f1/0/8
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate
!
end
  • ASW1
en
conf t
vtp mode transparent
vlan 1-2
exit
! shutdown unnecessary ports
int f0/1
shut
int f0/3
shut
int f0/4
shut
int f0/6
shut
!
int f0/8
! C2960 not supported
!switchport trunk encapsulation dot1q
switchport mode trunk
! not required
switchport nonegotiate
int f0/2
switchport mode access
switchport access vlan 1
int f0/5
switchport mode access
switchport access vlan 2
!
end
  • ASW2
en
conf t
vtp mode transparent
vlan 2-4
exit
! shutdown unnecessary ports
int f0/4
shut
int f0/8
shut
!
int f0/6
! C2960 not supported
!switchport trunk encapsulation dot1q
switchport mode trunk
! not required
switchport nonegotiate
int f0/1
switchport mode access
switchport access vlan 2
int f0/2
switchport mode access
switchport access vlan 3
int f0/3
switchport mode access
switchport access vlan 4
!
end

check on Pi1 interface status

pi@raspberrypi:~ $ ip a s eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:8a:37:19 brd ff:ff:ff:ff:ff:ff
    inet 172.16.2.1/24 brd 172.16.2.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 169.254.127.226/16 brd 169.254.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5300:1a7f:3d88:bd44/64 scope link
       valid_lft forever preferred_lft forever

router sub-interface configuration but physical interface not configured

en
conf t
int f0/0.1
encapsulation dot1q 1 native
ip addr 172.16.1.254 255.255.255.0
int f0/0.2
encapsulation dot1q 2
ip addr 172.16.2.254 255.255.255.0
int f0/0.3
encapsulation dot1q 3
ip addr 172.16.3.254 255.255.255.0
!
end
ping 172.16.1.1 -c2
ping 172.16.2.2 -c2
ping 172.16.2.4 -c2
ping 172.16.2.254 -c2
sh run int f0/0
sh run int f0/0.1
sh run int f0/0.2
sh run int f0/0.3
sh ip int b
sh ip ro
sh vlan brief
sh int f1/0/1 trunk
sh int f1/0/6 trunk
sh int f1/0/8 trunk
sh int f1/0/1 switchport
sh int f1/0/6 switchport
sh int f1/0/8 switchport
R1#sh run int f0/0
Building configuration...

Current configuration : 83 bytes
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
end

R1#sh run int f0/0.1
Building configuration...

Current configuration : 104 bytes
!
interface FastEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 172.16.1.254 255.255.255.0
end

R1#sh run int f0/0.2
Building configuration...

Current configuration : 97 bytes
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 172.16.2.254 255.255.255.0
end

R1#sh run int f0/0.3
Building configuration...

Current configuration : 97 bytes
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 172.16.3.254 255.255.255.0
end

R1#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES NVRAM  administratively down down
FastEthernet0/0.1          172.16.1.254    YES manual administratively down down
FastEthernet0/0.2          172.16.2.254    YES manual administratively down down
FastEthernet0/0.3          172.16.3.254    YES manual administratively down down
FastEthernet0/1            unassigned      YES NVRAM  administratively down down
Serial0/0/0                unassigned      YES NVRAM  administratively down down
R1#sh ip ro
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
       + - replicated route, % - next hop override

Gateway of last resort is not set
DSW1#sh vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0/1, Fa1/0/2, Fa1/0/3
                                                Fa1/0/4, Fa1/0/5, Fa1/0/7
                                                Fa1/0/9, Fa1/0/10, Fa1/0/11
                                                Fa1/0/12, Fa1/0/13, Fa1/0/14
                                                Fa1/0/15, Fa1/0/16, Fa1/0/17
                                                Fa1/0/18, Fa1/0/19, Fa1/0/20
                                                Fa1/0/21, Fa1/0/22, Fa1/0/24
                                                Gi1/0/1, Gi1/0/2
2    VLAN0002                         active
3    VLAN0003                         active
4    VLAN0004                         active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
DSW1#sh int f1/0/1 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/1     on               802.1q         other         1

Port        Vlans allowed on trunk
Fa1/0/1     none

Port        Vlans allowed and active in management domain
Fa1/0/1     none

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/1     none
DSW1#sh int f1/0/6 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/6     on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa1/0/6     1-4094

Port        Vlans allowed and active in management domain
Fa1/0/6     1-4

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/6     1-4
DSW1#sh int f1/0/8 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/8     on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa1/0/8     1-4094

Port        Vlans allowed and active in management domain
Fa1/0/8     1-4

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/8     1-4
DSW1#sh int f1/0/1 switchport
Name: Fa1/0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
DSW1#sh int f1/0/6 switchport
Name: Fa1/0/6
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
DSW1#sh int f1/0/8 switchport
Name: Fa1/0/8
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Pi1 → Pi3 ping successful.

pi@raspberrypi:~ $ ping 172.16.1.1 -c2
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
From 172.16.2.1 icmp_seq=1 Destination Host Unreachable
From 172.16.2.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.1.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1003ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.2.2 -c2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.745 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.709 ms

--- 172.16.2.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.709/0.727/0.745/0.018 ms
pi@raspberrypi:~ $ ping 172.16.2.4 -c2
PING 172.16.2.4 (172.16.2.4) 56(84) bytes of data.
From 172.16.2.1 icmp_seq=1 Destination Host Unreachable
From 172.16.2.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.4 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms
pipe 2
pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
From 172.16.2.1 icmp_seq=1 Destination Host Unreachable
From 172.16.2.1 icmp_seq=2 Destination Host Unreachable

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms
pipe 2

router sub-interface configuration correctly

en
conf t
int f0/0
no shut
!
end
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/0
R1(config-if)#no shut
R1(config-if)#!
R1(config-if)#end
R1#
*Mar 18 09:08:29.547: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Mar 18 09:08:32.519: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1#
DSW1#
*Mar  1 02:55:14.582: %LINK-3-UPDOWN: Interface FastEthernet1/0/1, changed state to up
*Mar  1 02:55:15.589: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to up
DSW1#
ping 172.16.1.1 -c2
ping 172.16.2.2 -c2
ping 172.16.4.1 -c2
ping 172.16.2.254 -c2
traceroute -n 172.16.1.1
sh run int f0/0
sh run int f0/0.1
sh run int f0/0.2
sh run int f0/0.3
sh ip int b
sh ip ro
sh vlan brief
sh int f1/0/1 trunk
sh int f1/0/1 switchport
R1#sh run int f0/0
Building configuration...

Current configuration : 73 bytes
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
end

R1#sh run int f0/0.1
Building configuration...

Current configuration : 104 bytes
!
interface FastEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 172.16.1.254 255.255.255.0
end

R1#sh run int f0/0.2
Building configuration...

Current configuration : 97 bytes
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 172.16.2.254 255.255.255.0
end

R1#sh run int f0/0.3
Building configuration...

Current configuration : 97 bytes
!
interface FastEthernet0/0.3
 encapsulation dot1Q 3
 ip address 172.16.3.254 255.255.255.0
end

R1#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES NVRAM  up                    up
FastEthernet0/0.1          172.16.1.254    YES manual up                    up
FastEthernet0/0.2          172.16.2.254    YES manual up                    up
FastEthernet0/0.3          172.16.3.254    YES manual up                    up
FastEthernet0/1            unassigned      YES NVRAM  administratively down down
Serial0/0/0                unassigned      YES NVRAM  administratively down down
R1#sh ip ro
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
       + - replicated route, % - next hop override

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
C        172.16.1.0/24 is directly connected, FastEthernet0/0.1
L        172.16.1.254/32 is directly connected, FastEthernet0/0.1
C        172.16.2.0/24 is directly connected, FastEthernet0/0.2
L        172.16.2.254/32 is directly connected, FastEthernet0/0.2
C        172.16.3.0/24 is directly connected, FastEthernet0/0.3
L        172.16.3.254/32 is directly connected, FastEthernet0/0.3
DSW1#sh vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0/2, Fa1/0/3, Fa1/0/4
                                                Fa1/0/5, Fa1/0/7, Fa1/0/9
                                                Fa1/0/10, Fa1/0/11, Fa1/0/12
                                                Fa1/0/13, Fa1/0/14, Fa1/0/15
                                                Fa1/0/16, Fa1/0/17, Fa1/0/18
                                                Fa1/0/19, Fa1/0/20, Fa1/0/21
                                                Fa1/0/22, Fa1/0/24, Gi1/0/1
                                                Gi1/0/2
2    VLAN0002                         active
3    VLAN0003                         active
4    VLAN0004                         active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
DSW1#sh int f1/0/1 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/1     on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa1/0/1     1-4094

Port        Vlans allowed and active in management domain
Fa1/0/1     1-4

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/1     1-4
DSW1#sh int f1/0/1 switchport
Name: Fa1/0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

ping successful each other except to Pi4 because of VLAN 4 sub-interface not configured.

pi@raspberrypi:~ $ ping 172.16.1.1 -c2
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=63 time=0.906 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=63 time=0.798 ms

--- 172.16.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.798/0.852/0.906/0.054 ms
pi@raspberrypi:~ $ ping 172.16.2.2 -c2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.760 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.733 ms

--- 172.16.2.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.733/0.746/0.760/0.030 ms
pi@raspberrypi:~ $ ping 172.16.4.1 -c2
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.
From 172.16.2.254 icmp_seq=1 Destination Host Unreachable
From 172.16.2.254 icmp_seq=2 Destination Host Unreachable

--- 172.16.4.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms

pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
64 bytes from 172.16.2.254: icmp_seq=1 ttl=255 time=1.11 ms
64 bytes from 172.16.2.254: icmp_seq=2 ttl=255 time=1.17 ms

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.119/1.145/1.172/0.042 ms
pi@raspberrypi:~ $ traceroute -n 172.16.1.1
traceroute to 172.16.1.1 (172.16.1.1), 30 hops max, 60 byte packets
 1  172.16.2.254  1.629 ms  1.815 ms  2.010 ms
 2  172.16.1.1  0.859 ms  0.740 ms  0.582 ms

Add VLAN 4 subinterface

en
conf t
int f0/0.4
encapsulation dot1q 4
ip addr 172.16.4.254 255.255.255.0
!
end
ping 172.16.2.2 -c2
ping 172.16.4.1 -c2
ping 172.16.2.254 -c2
traceroute -n 172.16.4.1
sh run int f0/0
sh run int f0/0.4
sh ip int b
sh ip ro
sh vlan brief
sh int f1/0/1 trunk
sh int f1/0/1 switchport
pi@raspberrypi:~ $ ping 172.16.2.2 -c2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.768 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.721 ms

--- 172.16.2.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.721/0.744/0.768/0.036 ms
pi@raspberrypi:~ $ ping 172.16.4.1 -c2
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.

--- 172.16.4.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1008ms

pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
64 bytes from 172.16.2.254: icmp_seq=1 ttl=255 time=1.19 ms
64 bytes from 172.16.2.254: icmp_seq=2 ttl=255 time=1.17 ms

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.174/1.182/1.191/0.035 ms

???

ASW1#sh int f0/8 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa0/8       on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa0/8       1-4094

Port        Vlans allowed and active in management domain
Fa0/8       1-2

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/8       1-2

VLAN pruning…

ASW1#sh vlan bri

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/6, Fa0/7, Gi0/1
2    VLAN0002                         active    Fa0/5
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
ASW1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ASW1(config)#vlan 1-4
ASW1(config-vlan)#exit
ASW1(config)#do sh vlan bri

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/6, Fa0/7, Gi0/1
2    VLAN0002                         active    Fa0/5
3    VLAN0003                         active
4    VLAN0004                         active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
ASW1(config)#^Z
ASW1#sh vlan bri
*Mar  1 03:22:36.602: %SYS-5-CONFIG_I: Configured from console by console
ASW1#sh int f0/8 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa0/8       on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa0/8       1-4094

Port        Vlans allowed and active in management domain
Fa0/8       1-4

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/8       1-2
pi@raspberrypi:~ $ ping 172.16.2.2 -c2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.790 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.730 ms

--- 172.16.2.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.730/0.760/0.790/0.030 ms
pi@raspberrypi:~ $ ping 172.16.4.1 -c2
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.

--- 172.16.4.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1006ms

pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
64 bytes from 172.16.2.254: icmp_seq=1 ttl=255 time=1.20 ms
64 bytes from 172.16.2.254: icmp_seq=2 ttl=255 time=1.16 ms

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.162/1.182/1.203/0.040 ms
pi@raspberrypi:~ $ ping 172.16.4.1 -c2
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.

--- 172.16.4.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1005ms

???

…. oh,…. Pi4 default gateway configuration not exists…

pi@raspberrypi:~ $ ping 172.16.4.1
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.
64 bytes from 172.16.4.1: icmp_seq=174 ttl=63 time=1.88 ms
64 bytes from 172.16.4.1: icmp_seq=175 ttl=63 time=0.932 ms
64 bytes from 172.16.4.1: icmp_seq=176 ttl=63 time=0.905 ms
64 bytes from 172.16.4.1: icmp_seq=177 ttl=63 time=0.989 ms
64 bytes from 172.16.4.1: icmp_seq=178 ttl=63 time=0.938 ms
64 bytes from 172.16.4.1: icmp_seq=179 ttl=63 time=0.981 ms
64 bytes from 172.16.4.1: icmp_seq=180 ttl=63 time=0.909 ms
64 bytes from 172.16.4.1: icmp_seq=181 ttl=63 time=0.935 ms
64 bytes from 172.16.4.1: icmp_seq=182 ttl=63 time=0.899 ms
64 bytes from 172.16.4.1: icmp_seq=183 ttl=63 time=0.889 ms
^C
--- 172.16.4.1 ping statistics ---
183 packets transmitted, 10 received, 94% packet loss, time 182017ms
rtt min/avg/max/mdev = 0.889/1.025/1.882/0.290 ms
pi@raspberrypi:~ $

finally, ping successful each other.

pi@raspberrypi:~ $ ping 172.16.1.1 -c2
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=63 time=0.924 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=63 time=0.848 ms

--- 172.16.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.848/0.886/0.924/0.038 ms
pi@raspberrypi:~ $ ping 172.16.2.2 -c2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.812 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.737 ms

--- 172.16.2.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.737/0.774/0.812/0.046 ms
pi@raspberrypi:~ $ ping 172.16.4.1 -c2
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.
64 bytes from 172.16.4.1: icmp_seq=1 ttl=63 time=1.01 ms
64 bytes from 172.16.4.1: icmp_seq=2 ttl=63 time=0.913 ms

--- 172.16.4.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.913/0.961/1.010/0.057 ms
pi@raspberrypi:~ $ ping 172.16.2.254 -c2
PING 172.16.2.254 (172.16.2.254) 56(84) bytes of data.
64 bytes from 172.16.2.254: icmp_seq=1 ttl=255 time=1.19 ms
64 bytes from 172.16.2.254: icmp_seq=2 ttl=255 time=1.16 ms

--- 172.16.2.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.162/1.179/1.197/0.038 ms
pi@raspberrypi:~ $ traceroute -n 172.16.4.1
traceroute to 172.16.4.1 (172.16.4.1), 30 hops max, 60 byte packets
 1  172.16.2.254  1.588 ms  1.842 ms  2.034 ms
 2  172.16.4.1  0.981 ms  1.017 ms  1.205 ms

Irregular configuration: native vlan usin physical interface

same above configuration, works properly, but is not regular configuration design.

en
conf t
no int f0/0.1
int f0/0
ip addr 172.16.1.254 255.255.255.0
!
end
sh run int f0/0
sh run int f0/0.1
sh run int f0/0.2
sh run int f0/0.3
sh run int f0/0.4
sh ip int b
sh ip ro


of course, ping successful each other.



packet capture

on Pi1

ping to same VLAN node.

ping 172.16.2.2

ping to different VLAN node.

ping 172.16.3.1

filter

not (stp or dns)

on f1/0/1 DSW1

monitor session 1 source interface FastEthernet 1/0/1
monitor session 1 destination interface FastEthernet 1/0/23 encapsulation replicate

this link observed only different VLAN traffic, or ARP.

different vlan.

on Pi1

pi@raspberrypi:~ $ ping 172.16.4.1
PING 172.16.4.1 (172.16.4.1) 56(84) bytes of data.
64 bytes from 172.16.4.1: icmp_seq=1 ttl=63 time=1.00 ms
64 bytes from 172.16.4.1: icmp_seq=2 ttl=63 time=0.947 ms
64 bytes from 172.16.4.1: icmp_seq=3 ttl=63 time=0.955 ms
64 bytes from 172.16.4.1: icmp_seq=4 ttl=63 time=0.886 ms
64 bytes from 172.16.4.1: icmp_seq=5 ttl=63 time=0.915 ms
64 bytes from 172.16.4.1: icmp_seq=6 ttl=63 time=0.927 ms
64 bytes from 172.16.4.1: icmp_seq=7 ttl=63 time=0.874 ms
64 bytes from 172.16.4.1: icmp_seq=8 ttl=63 time=0.909 ms
64 bytes from 172.16.4.1: icmp_seq=9 ttl=63 time=0.888 ms
64 bytes from 172.16.4.1: icmp_seq=10 ttl=63 time=0.864 ms
64 bytes from 172.16.4.1: icmp_seq=11 ttl=63 time=0.862 ms
64 bytes from 172.16.4.1: icmp_seq=12 ttl=63 time=0.897 ms
64 bytes from 172.16.4.1: icmp_seq=13 ttl=63 time=0.913 ms
64 bytes from 172.16.4.1: icmp_seq=14 ttl=63 time=0.923 ms
64 bytes from 172.16.4.1: icmp_seq=15 ttl=63 time=0.900 ms
^C
--- 172.16.4.1 ping statistics ---
15 packets transmitted, 15 received, 0% packet loss, time 14018ms
rtt min/avg/max/mdev = 0.862/0.911/1.008/0.041 ms

same vlan arp

R1#clear mac-address-table dynamic
DSW1#clear mac address-table dynamic
ASW1#clear mac address-table dynamic
ASW2#clear mac address-table dynamic
pi@raspberrypi:~ $ sudo ip -s -s neigh flush all

on f1/0/8 DSW1

no monitor session 1 source interface FastEthernet 1/0/1
monitor session 1 source interface FastEthernet 1/0/8
monitor session 1 destination interface FastEthernet 1/0/23 encapsulation replicate
pi@raspberrypi:~ $ ping 172.16.2.2
PING 172.16.2.2 (172.16.2.2) 56(84) bytes of data.
64 bytes from 172.16.2.2: icmp_seq=1 ttl=64 time=0.741 ms
64 bytes from 172.16.2.2: icmp_seq=2 ttl=64 time=0.664 ms
64 bytes from 172.16.2.2: icmp_seq=3 ttl=64 time=0.676 ms
64 bytes from 172.16.2.2: icmp_seq=4 ttl=64 time=0.688 ms
64 bytes from 172.16.2.2: icmp_seq=5 ttl=64 time=0.708 ms
64 bytes from 172.16.2.2: icmp_seq=6 ttl=64 time=0.690 ms
64 bytes from 172.16.2.2: icmp_seq=7 ttl=64 time=0.708 ms
64 bytes from 172.16.2.2: icmp_seq=8 ttl=64 time=0.692 ms
64 bytes from 172.16.2.2: icmp_seq=9 ttl=64 time=0.683 ms
64 bytes from 172.16.2.2: icmp_seq=10 ttl=64 time=0.692 ms
64 bytes from 172.16.2.2: icmp_seq=11 ttl=64 time=0.696 ms
64 bytes from 172.16.2.2: icmp_seq=12 ttl=64 time=0.749 ms
64 bytes from 172.16.2.2: icmp_seq=13 ttl=64 time=0.695 ms
64 bytes from 172.16.2.2: icmp_seq=14 ttl=64 time=0.668 ms
64 bytes from 172.16.2.2: icmp_seq=15 ttl=64 time=0.685 ms
64 bytes from 172.16.2.2: icmp_seq=16 ttl=64 time=0.682 ms
64 bytes from 172.16.2.2: icmp_seq=17 ttl=64 time=0.677 ms
64 bytes from 172.16.2.2: icmp_seq=18 ttl=64 time=0.682 ms
64 bytes from 172.16.2.2: icmp_seq=19 ttl=64 time=0.697 ms
64 bytes from 172.16.2.2: icmp_seq=20 ttl=64 time=0.709 ms
^C
--- 172.16.2.2 ping statistics ---
20 packets transmitted, 20 received, 0% packet loss, time 19021ms
rtt min/avg/max/mdev = 0.664/0.694/0.749/0.023 ms

References

tech/network/inter-vlan-routing-router-on-a-stick/inter-vlan-routing-router-on-a-stick.txt · Last modified: 2018/03/18 20:27 by wnoguchi