Professional Documents
Culture Documents
07.Switching+Basics+-+Route+Reachability+Between+VLANs
07.Switching+Basics+-+Route+Reachability+Between+VLANs
Course Objectives
Layer 2 communication
VLAN10 VLAN20
Communication fails.
Inter-VLAN Routing Through a Router
Router
GE0/0/1 GE0/0/2
• The easiest way to implement inter-
192.168.10.254 192.168.20.254 VLAN communication is using a
router.
GE0/0/23
• In this example, the router uses one
GE0/0/24
physical interface to serve one VLAN.
G
E0
/1
/2
E0
G
SW
must be configured as access
interfaces, and each be added to a
specific VLAN.
GE0/0/1
GE0/0/1.10 GE0/0/1.20 • In this example, the router has more
192.168.10.254 192.168.20.254 than one sub-interface configured
for a physical interface, with one sub-
GE0/0/24 interface serving one VLAN.
(Trunk interface)
• A sub-interface is a software-based,
GE
/1
E 0/
0 0/
0/
2
logical interface. It is easy to add and
G
SW maintain sub-interfaces.
Switch Router
VLAN10
GE0/0/1
PC1
Trunk GE0/0/0
GE0/0/2
VLAN20
PC2
G0/0/1
GE0/0/1.10
GE0/0/1.20
G0/0/1 Trunk
GE0/0/1.10 GE0/0/1.20
vlan-type dot1q 10 vlan-type dot1q 20
ip address 192.168.10.1 24 ip address 192.168.20.1 24
VLAN 10 VLAN 20
Trust DMZ
Contents
Layer 3 switch
Switching module
10 10 20 20
VLAN 10 VLAN 20
Basic Configurations of VLANIF Interfaces
SW
G0/0/1 G0/0/2
GE0/0/0
192.168.99.2/24 Router
GE0/0/24
Layer 3 switch
T 99
Tr
Layer 2 switch
u
nk
GE0/0/1 GE0/0/2 GE0/0/22
10 20 T
T Trunk interface
10 20 99 Access interface
192.168.10.1/24 192.168.20.1/24
GW:192.168.10.254 GW:192.168.20.254
Configuration Example for Networking with Layers 2 and 3 Switches and a Router
• # Configure SW1.
[SW1] vlan batch 10 20
[SW1] interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1] port link-type access
[SW1-GigabitEthernet0/0/1] port default vlan 10
[SW1] interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2] port link-type access
[SW1-GigabitEthernet0/0/2] port default vlan 20
[SW1] interface GigabitEthernet 0/0/22
[SW1-GigabitEthernet0/0/22] port link-type trunk
[SW1-GigabitEthernet0/0/22] port trunk allow-pass vlan 10 20
Configuration Example for Networking with Layers 2 and 3 Switches and a Router
• # Configure SW2.
[SW2] vlan batch 10 20 99
[SW2] interface GigabitEthernet 0/0/22
[SW2-GigabitEthernet0/0/22] port link-type trunk
[SW2-GigabitEthernet0/0/22] port trunk allow-pass vlan 10 20
# Configure GE 0/0/24 that connects to the router.
[SW2] interface GigabitEthernet 0/0/24
[SW2-GigabitEthernet0/0/24] port link-type access
[SW2-GigabitEthernet0/0/24] port default vlan 99(continued)
Configuration Example for Networking with Layers 2 and 3 Switches and a Router
• # Configure SW2.
[SW2] interface vlanif 10
[SW2-vlanif10] ip address 192.168.10.254 24
[SW2] interface vlanif 20
[SW2-vlanif20] ip address 192.168.20.254 24
[SW2] interface vlanif 99
[SW2-vlanif99] ip address 192.168.99.1 24
# Configure a default route destined for SW2, with the next hop being the router.
[SW2] ip route-static 0.0.0.0 0.0.0.0 192.168.99.2
Configuration Example for Networking with Layers 2 and 3 Switches and a Router