Inter-VLAN Routing Facts
In a typical configuration with multiple VLANs and a single or multiple switches, workstations in one VLAN will not be able to communicate with workstations in other VLANs. To enable inter-VLAN communication, you will need to use a router (or a Layer 3 switch) as shown in the following graphic.
Be aware of the following conditions with inter-VLAN routing:
- The top example uses two physical interfaces on the router.
- The bottom example uses a single physical interface on the router. In this configuration, the physical interface is divided into two logical interfaces called subinterfaces. This configuration is also called a router on a stick.
- In each case, the router interfaces are connected to switch trunk ports. The router interfaces or subinterfaces must be running a trunking protocol (either ISL or 802.1Q).
- Each interface or subinterface requires an IP address.
- In this simple configuration, no routing protocol is needed because each interface on the router is directly connected.
- To support additional VLANs, add more physical interfaces or logical subinterfaces to the router.
The following commands configure a router with a single interface to perform inter-VLAN routing for VLAN 1 and VLAN 20:
Router(config)#interface fa0/1
Router(config-if)#no ip address
Router(config-if)#interface fa0/1.1
Router(config-if)#description subinterface for VLAN 1
Router(config-if)#encapsulation dot1Q 1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#interface fa0/1.20
Router(config-if)#description subinterface for VLAN 20
Router(config-if)#encapsulation dot1Q 20
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Tidak ada komentar:
Posting Komentar