这是我在模拟器上做的
拓朴图如上:
vlan 1:PC1,PC3 network:10.1.2.0/24
vlan 2:PC2,PC4 network:10.1.3.0/24
目标:实现vlan互访
[注:]当网络大且杂的时候,最好是建一张表格
-------------------------------------------
1,配置S1
首先PC1连接的交换机S1上,创建vlan1,vlan2,把S1设为vtp server,vtp域名为vtpserver
S1#vlan database
S1(vlan)#vlan 1 name vlan1
S1(vlan)#vlan 2 name vlan2
S1(vlan)#vtp server
S1(vlan)#vtp domain vtpserver
S1(vlan)#apply
---------------------------------------------
把S1的fa0/3,fa0/4设为access模式 。fa0/1 ,fa0/12设trunk模式
配置fa0/3
S1(config)#interface fa0/3
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 1
-----------------------------------------------
配置fa0/4
S1(config)#interface fa0/4
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 2
------------------------------------------------
配置fa0/12
S1(config)#interface fa0/12
S1(config-if)#switchport mode trunk
S1(config-if)#switchport access vlan all
--------------------------------------------
配置fa0/1
S1(config)#interface fa0/1
S1(config-if)#switchport mode trunk
S1(config-if)#switchport access vlan all
S1(config-if)#speed auto
--------------------------------------------
2,配置S2
fa0/3和fa0/4配置与S1一样,vtp设为client
S2#vlan database
S2(vlan)#vtp client
S2(vlan)#apply
-------------------------------------------
配置fa0/12
S2(config)#interface fa0/12
S2(config-if)#switchport mode trunk
S2(config-if)#switchport access vlan all
------------------------------------------
3,配置路由器
Router(config)#interface e0
Router(config-if)#no shutdown
Router(config-if)#int e0/0.1 //进入e0/0.1逻辑接口模式
Router(config-subif)#encapsulation dot1q 1 //帧标识为封装为IEEE802.1Q,允许valn1通过
Router(config-subif)#ip add 10.1.2.1 255.255.255.0
Router(config-subif)#exit
Router(config)#int e0/0.2
Router(config-subif)#encapsulation dot1q 2//帧标识为封装为IEEE802.1Q,允许valn2通过
-------------------------------------------
启动路由:
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 10.0.0.0
-------------------------------------------
设置PC的IP
pc1:10.1.2.2
pc2:10.1.3.4
pc3:10.1.2.3
pc4:10.1.3.2
现在余下就是ping^^^^^^^^^^^^^^
阅读(1419) | 评论(0) | 转发(0) |