Network Routing
Configure Inter-VLAN Routing
- Configure the VLAN on the switches in the network.
SW1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)# vlan 3
SW1(config-vlan)# name Marketing
SW1(config-vlan)# exit
- Configure the access ports on the switches in the network which service devices in specific VLANs.
SW1(config)# interface Ethernet 1/0
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 3
SW1(config-if)# end
SW1#
- Verify configuration on VLANs on the switches in the network.
SW1# show vlan id 3
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
3 Marketing active Et0/0, Et1/0
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
3 enet 100003 1500 - - - - - 0 0
Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
- Configure the trunk link from the switch to the router
SW1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)# interface Ethernet 0/2
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport trunk native vlan 256
SW1(config-if)# switchport trunk allowed vlan 2,3
SW1(config-if)# switchport mode trunk
SW1(config-if)# end
SW1#
*Oct 30 09:55:41.399: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to down
*Oct 30 09:55:44.049: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to up
- Configure the sub interfaces on the router connected to the switch's trunk port
R1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)# interface Ethernet0/1
R1(config-if)# no ip address
- Create the sub interfaces for any VLANs needing to be routed
R1(config-if)# interface Ethernet 0/1.2
R1(config-subif)# encapsulation dot1q 2
R1(config-subif)# ip address 10.10.2.1 255.255.255.0
R1(config-subif)# interface Ethernet 0/1.3
R1(config-subif)# encapsulation dot1q 3
R1(config-subif)# ip address 10.10.3.1 255.255.255.0
R1(config-subif)# end
R1#
- Configure any IP addresses for devices connected to switch access ports
PC3# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
PC3(config)# interface Ethernet 0/0
PC3(config-if)# ip address 10.10.3.30 255.255.255.0
PC3(config-if)# exit
PC3(config)# ip default-gateway 10.10.3.1
PC3(config)# end
PC3#