标签:address enc mob download info nal one col ring
路由器的配置:
Router(config)#
Router(config)#int f0/0
Router(config-if)#no shut
Router(config-if)#no shutdown
Router(config-if)#int f0/0.1 #进入子接口
Router(config-subif)#encapsulation dot1Q 2 #封装为doc1Q 且为vlan2
Router(config-subif)#ip add
Router(config-subif)#ip address 192.168.1.254 255.255.255.0 #添加I
Router(config-subif)#int f0/0.2
Router(config-subif)#encapsulation dot1Q 3
Router(config-subif)#ip address 192.168.2.254 255.255.255.0
退出:
Router#show ip route 查看路由表生成的两条路由
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0.1 #directly:直接
C 192.168.2.0/24 is directly connected, FastEthernet0/0.2
Router#
此时的vlan2与vlan3PC机虽然不同的vlan但是却可以相互通信
标签:address enc mob download info nal one col ring
原文地址:https://blog.51cto.com/14847540/2505154