对pc4使用 C:>ping 192.168.3.2,发现pc4和pc3可以通信.
对pc5使用 C:>ping 192.168.4.2,发现pc5和pc4可以通信.
3.3、VLAN的划分
创建VLAN,使各个系之间不互相通信。 SW1的配置如下: Switch>en Switch>conf t Switch>host sw1 Switch(config)#exit sw1#vlan database sw1(vlan)#vlan 2 VLAN 2 added: Name: VLAN0002
sw1(vlan)#vlan 3 VLAN 3 added: Name: VLAN0003 sw1(vlan)#vlan 4 VLAN 4 added: Name: VLAN0004 sw1(vlan)#vlan 5 VLAN 5 added: Name: VLAN0005 sw1(vlan)#exit sw1#conf t
sw1(config)#int f0/2
sw1(config-if)#switchport access vlan 2 sw1(config-if)#exit sw1(config)#int f0/3
sw1(config-if)#switchport acc vlan 3 sw1(config-if)#exit sw1(config)#int f0/4
sw1(config-if)#sw acc vlan 4 sw1(config-if)#exit sw1(config)#int f0/5
sw1(config-if)#sw acc vlan 5 sw1(config-if)#exit sw1(config)#int f0/12
sw1(config-if)#switchport mo trunk
sw1(config-if)#switchport trunk encapsulation dot1q sw1(config-if)#exit sw1(config)#end sw1#show vlan
此时,显示结果为:
配好之后检测PC之间的联通性,发现彼此不互相通信. 使用ping命令
对pc1使用 C:>ping 192.168.2.2,发现pc1和pc2不互相通信.
对pc2使用 C:>ping 192.168.1.2,发现pc2和pc1不互相通信.
对pc3使用 C:>ping 192.168.2.2,发现pc3和pc2不互相通信.
对pc4使用 C:>ping 192.1683.2,发现pc4和pc3不互相通信.
对pc55使用 C:>ping 192.168.4.2,发现pc5和pc4不互相通信.
3.4、路由协议规划
配好之后检测PC之间的联通性,发现彼此不互相通信,是由于每个VLAN就相当于一个虚拟的局域网。要想让不同VLAN之间能互相通信,通过单臂路由来实现!具体配置过程如下: Router>en Router>conf t Router>host r1 Router>exit R1#config t
R1(config)#int f0/0 R1(config-if)#no shut R1(config-if)#int f0/0.1
R1(config-subif)#encapsulation dot1Q 1
R1(config-subif)#ip addr 192.168.1.1 255.255.255.0 R1(config-subif)#int f0/0.2
R1(config-subif)#encapsulation dot1Q 2
R1(config-subif)#ip addr 192.168.2.1 255.255.255.0 R1(config-subif)#int f0/0.3
R1(config-subif)#encapsulation dot1Q 3
R1(config-subif)#ip addr 192.168.3.1 255.255.255.0 R1(config-subif)#int f0/0.4
R1(config-subif)#encapsulation dot1Q 4
R1(config-subif)#ip addr 192.168.4.1 255.255.255.0
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库校园网建设方案范例 (2)(3)在线全文阅读。
相关推荐: