思科交换机学习第八课:路由器单臂路由配置实现vlan互通_思科路由器配置vlan
思科交换机学习第八课:路由器单臂路由配置实现vlan互通由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“思科路由器配置vlan”。
Switch>enable
2960 Switch#configure terminal Switch(config)#vlan 2 Switch(config-vlan)#exit
第一步 创建vlan Switch(config)#vlan 3 Switch(config-vlan)#exit Switch(config)#interface fastEthernet 0/2 Switch(config-if)#switchport acce vlan 2 Switch(config-if)#exit Switch(config)#interface fastEthernet 0/3
端口划分vlan Switch(config-if)#switchport acce vlan 3 Switch(config-if)#exit Switch(config)#interface fastEthernet 0/1 Switch(config-if)#switchport mode trunk
交换机跟路由器连接的端口改为trunk Switch(config-if)#exit
Router>enable
开启路由器端口 Router#configure terminal
Router(config)#interface fastEthernet 0/0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#interface fastEthernet 0/0.1
进入子端口 Router(config-subif)# %LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up
Router(config-subif)#encapsulation dot1Q 2 Router(config-subif)#ip addre 192.168.1.1 255.255.255.0 Router(config-subif)#exit Router(config)#interface fastEthernet 0/0.2
进入子端口 Router(config-subif)# %LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up
Router(config-subif)#encapsulation dot1Q 3 Router(config-subif)#ip addre 192.168.2.1 255.255.255.0 Router(config-subif)#end Router#show ip route
Codes: Cstatic, IRIP, MBGP
DEIGRP external, OOSPF inter area
N1OSPF NSSA external type 2
E1OSPF external type 2, EIS-IS, L1IS-IS level-2, iacandidate default, UODR
P-periodic downloaded static route
Gateway of last resort is not set
C
192.168.1.0/24 is directly connected, FastEthernet0/0.1 C
192.168.2.0/24 is directly connected, FastEthernet0/0.2
dot1q就是802.1q,是vlan的一种封装方式。
cisco模拟器中dot1Q 2是什么意思? 答
封装为dot1q,这个是trunk的封装
后面的2是VLAN ID,指的就是路由下联的交换机上划分的VLAN号