Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2708294
  • 博文数量: 335
  • 博客积分: 10218
  • 博客等级: 上将
  • 技术积分: 3480
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-29 12:05
文章分类

全部博文(335)

文章存档

2017年(1)

2012年(1)

2009年(27)

2008年(61)

2007年(107)

2006年(138)

我的朋友

分类: 系统运维

2006-07-28 10:30:22

 
[SwitchA]vlan 2
[SwitchA-vlan2]port e0/3 to e0/4
[SwitchA]vlan 3
[SwitchA-vlan3]port e0/5 to e0/6
[SwitchB]vlan 2
[SwitchB-vlan2]port e0/3 to e0/4
[SwitchB]vlan 3
[SwitchB-vlan3]port e0/5 to e0/6
设置计算机的IP为:
PCA:10.65.1.1  PCB:10.66.1.1  PCC:10.65.1.3  PCD:10.66.1.3
[root@PCA root]#ping 10.65.1.1  通   (本机IP)
[root@PCA root]#ping 10.65.1.3  不通 (中间连接线是vlan 1)
[root@PCA root]#ping 10.66.1.1  不通 (不同网络,不同vlan)
[root@PCA root]#ping 10.66.1.3  不通 (不同网络,不同vlan)
[root@PCB root]#ping 10.66.1.3  不通 (中间连接线是vlan 1)
将PCA改接到SwitchA E0/2 (vlan 1)
[root@PCA root]#ping 10.65.1.3  不通 (同网络,不同vlan)
将PCC改接到SwitchB E0/2 (vlan 1)
[root@PCA root]#ping 10.65.1.3  通  (同网络,同在vlan 1)
再改回来,并设置trunk:
[S3026A]interface ethernet 0/8
[S3026A-Ethernet0/8]port link-type trunk
[S3026A-Ethernet0/8]port trunk permit vlan all
[S3026B]interface ethernet 0/1
[S3026B-Ethernet0/1]port link-type trunk
[S3026B-Ethernet0/1]port trunk permit vlan all
[root@PCA root]#ping 10.65.1.3  通
[root@PCA root]#ping 10.66.1.3  不通
[root@PCB root]#ping 10.66.1.3  通
即:PCA和PCC同在vlan 2 是通的,PCB和PCD同在vlan 3是通的。
    PCA和PCB是不通的。同理PCC和PCD也是不通的。
    再加入一个交换机switchC,将它串入switchA和switchB之间,连接方式:
    switchA:E0/8-->switchC:E0/3; switchC:E0/6-->switchB:E0/1
(1) 新加入的SwitchC 默认状态时,测试连通性。
    从PCA->PCC,从PCB->PCD 测试:
[root@PCA root]# ping 10.65.1.3 (不通)
[root@PCB root]# ping 10.66.1.3 (不通)
    由于新加入的交换机没有设置trunk,所有接口默认vlan 1,对于交换机而言,
trunk 要成对出现,如果dot1q不能和另一端交换信息会自动down掉。

(2) 将交换机之间的连线都设置成trunk时,再测试连通性。
[S3026C]interface ethernet0/3
[S3026C-Ethernet0/1]port link-type trunk
[S3026C-Ethernet0/1]port trunk permit vlan all
[S3026C]interface ethernet0/6
[S3026C-Ethernet0/8]port link-type trunk
[S3026C-Ethernet0/8]port trunk permit vlan all
现在有两条正确的trunk,再看一下联通情况:
[root@PCA root]# ping 10.65.1.3 (通)
[root@PCB root]# ping 10.66.1.3 (通)
(3) 设置vtp
    VTP是vlan 传输协议,在VTP Server上配置的vlan 在条件允许条件下,可以
从VTP Client 端看到VTP Server上的vlan,并将自己端口加入到vlan中。
[S3026C]vtp domain abc
[S3026C]vtp mode server
[S3026C]vtp password ok
[S3026B]vtp domain abc
[S3026B]vtp mode client
[S3026B]vtp password ok
[S3026A]#disp vlan
[S3026B]#disp vlan
[S3026C]#disp vlan
    当口令和域名一致时,client端可以学习到server端的vlan,在VTP Server端还
可以有很多策略,这里只是说明最基本的问题。
    VTP在企业、机关、学校的应用是很多的,在主交换机上设置好vlan以后,下级的
交换机不用再设置vlan,可以将client的某些端口添加到VTP Server中定义的vlan中
去,加强了管理。
阅读(2483) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~