VLAN间路由
-
每个路由器接口对应一个VLAN
例6-1 配置每个路由器接口对应一个VLANR1# configure terminal R1(config)# interface f0/0 R1(config-if)# ip address 172.17.10.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# interface f0/1 R1(config-if)# ip address 172.17.30.1 255.255.255.0 R1(config-if)# no shutdown
例6-2 查看路由表
R1# show ip route
-
单臂路由器
例6-3 配置子接口R1# configure terminal R1(config)# interface f0/0.10 R1(config-subif)# encapsulation dot1q 10 R1(config-subif)# ip address 172.17.10.1 255.255.255.0 R1(config-subif)# interface f0/0.30 R1(config-subif)# encapsulation dot1q 30 R1(config-subif)# ip address 172.17.30.1 255.255.255.0 R1(config-subif)# interface f0/0 R1(config-if)# no shutdown
-
实际配置单臂路由器VLAN间路由
例6-9 配置单臂路由器:交换机S1# configure terminal S1(config)# vlan 10 S1(config-vlan)# vlan 30 S1(config-vlan)# interface f0/5 S1(config-if)# switchport mode trunk S1(config-if)# end S1# copy running-config startup-config
例6-10 配置单臂路由器
R1# configure terminal R1(config)# interface f0/0.10 R1(config-subif)# encapsulation dot1q 10 R1(config-subif)# ip address 172.17.10.1 255.255.255.0 R1(config-subif)# interface f0/0.30 R1(config-subif)# encapsulation dot1q 30 R1(config-subif)# ip address 172.17.30.1 255.255.255.0 R1(config-subif)# interface f0/0 R1(config-if)# no shutdown