实验目的
        掌握VLAN及VTP配置
        理解802.1Q和ISL的区别
        理解VTP的三种模式。
        理解修订号的具体意义。
实验拓扑
fgfdg
实验要求:VTP域名为cisco,密码为ccnp
                  sw1配置成Server模式,创建VLAN 10和VLAN 20命名为 aa     bb,并开启VTP修剪功能
sw2配置成客户模式,并将端口1-10加入VLAN 10,11-20划分到VLAN20
sw3配置成客户模式
实验过程
步骤1   在sw1上创建VLAN 10和VLAN20
sw1# vlan database                       //进入数据库模式
sw1(vlan)# vlan 10 name aa      //划分VLAN并命名
sw1(vlan)# vlan 20 name bb
步骤2 因为VTP信息只在trunk接口上发送,所以先将交换机相连的接口配置成trunk接口
sw1(config)# interface fastethernet 0/10    //进入接口
sw1(config-if)# switchport mode trunk              //把接口封装成trunk
sw1(config-if)# switchport trunk encapsulation dot1q   //如果交换机支持多种trunk封装,则必须先指定所使用的封装。如3550交换机;如果只支持一种封装,则没有此命令,如2950.
sw1(config-if)# switchport trunk allowed vlan 1,1002-1005,2,10,20  //指定要传递的VLAN
sw2(config)# interface fastethernet0/14
sw2(config-if)# switchport mode trunk
sw2(config-if)# switchport trunk encapsulation dot1q
sw3(config)# interface fastethernet 0/14
sw3(config-if)# switchport mode trunk     
sw3(config-if)# switchport trunk encapsulation dot1q
sw3(config-if)# interface fastethernet 0/10
sw3(config-if)# switchport mode trunk
sw3(config-if)# switchport trunk encapsulation dot1q
步骤3 在sw1 上做VTP的配置
sw1(vlan)# vtp server   
//配置SW1 为VTP server模式,实际上这是默认值
sw1(vlan)#vtp domain cisco
//配置VTP 域名
sw1(vlan)#vtp password ccnp  
   //配置VTP 的密码,目的是为了安全,防止不明身份的交换机加入到域中
sw1(vlan)#vtp pruning   //开启VTP修剪
 
SW1(config)#vtp mode server

SW1(config)#vtp domain cisco
SW1(config)#vtp password ccnp    //蓝色文字是在全局控制模式下做VTP的配置,一般1900系列交换机在全局控制模式下配置VTP,而2500系列是在数据库模式下配置。
步骤4  在sw2上做配置
sw2#vlan database
sw2(vlan)#vtp client   //配置SW2为客户模式
sw2(vlan)#vtp domain cisco
sw2(vlan)#vtp password ccnp
sw2(vlan)#exit   //退出数据口模式使配置生效。
步骤5 在sw3上做配置
sw3#vlan database
sw3(vlan)#vtp transparent //配置SW3为透明模式
sw3(vlan)#exit
步骤6  在sw3、sw2上查看VLAN信息,看是否可以看到创建的VLAN 10和VLAN 20
在查看前要激活各个封装成Trunk的接口
sw3#show vlan-switch   //查看VLAN信息
VLAN Name                             Status    Ports
—- ——————————– ——— ——————————-
1    default                          active    Fa0/0, Fa0/1, Fa0/2, Fa0/3
                                                Fa0/4, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13, Fa0/15
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active        //我们发现SW3没有学习到VLAN信息。说明透明模式不能不同步服务器的VLAN信息。
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1    enet  100001     1500  -      -      -        -    -        1002   1003
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0  
1005 trnet 101005     1500  -      -      1        ibm  -        0      0
sw2#show vlan-switch    //查看VLAN信息
VLAN Name                             Status    Ports
—- ——————————– ——— ——————————-
1    default                          active    Fa0/0, Fa0/1, Fa0/2, Fa0/3
                                                Fa0/4, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/15
2    benzhenvlan                      active   
10   aa                               active   
20   bb                               active
    //sw2已经同步了sw1的VLAN 信息,说明客户模式可以同步VLAN信息。sw3、没有学习到,而sw2学习到了VLAN 信息说名透明模式转发VLAN。
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1    enet  100001     1500  -      -      -        -    -        1002   1003
2    enet  100002     1500  -      -      -        -    -        0      0  
10   enet  100010     1500  -      -      -        -    -        0      0  
20   enet  100020     1500  -      -      -        -    -        0      0  
1002 fddi  101002     1500  -      0      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0  
1005 trnet 101005     1500  -      -      1        ibm  -        0      0
sw2#show vtp status                 //查看VTP状态         
VTP Version                     : 2           //该VTP支持版本2                   
Configuration Revision          : 3    //修订号为:2  说明进行过2次配置,每配置一次修订号加一。当我们在现实做工程时。当网络中有新的交换机加入时,我们要确定新加入的交换机的修订号小与其他的交换机。
Maximum VLANs supported locally : 256  //支持的最大VLAN数量:256
Number of existing VLANs        : 8                  //现有的VLAN数量 为:8
VTP Operating Mode              : Client             //VTP的模式为客户模式
VTP Domain Name                 : cisco              //VTP的域名为cisco
VTP Pruning Mode                 : Enabled           //VTP的修剪应经打开
VTP V2 Mode                          : Disabled       //VTP版本2没有启用
VTP Traps Generation            : Disabled
MD5 digest                      : 0×0F 0×88 0×40 0×00 0xD9 0×0F 0×66 0×97
Configuration last modified by 0.0.0.0 at 3-1-02 01:52:39
总结VTP的三种模式:
Server(服务器模式) :可以创建、修改、删除VLAN信息;可以发送和转发VLAN信息;可以同步VLAN信息;可以保存VLAN信息到NVRM中。
Client(客户端模式):不能创建、修改、删除VLAN信息;转发VLAN信息;可以同步VLAN信息;不保存VLAN信息到NVRM中
Transparent(透明模式):可以创建、修改、删除VLAN信息;转发VLAN信息;不同步同步VLAN信息;保存VLAN信息到NVRM中
总结:802.1q和ISL
他们都用于标记数据的。
ISL:在原有的帧上重新加了一个26字节的帧头并重新生成了帧校验序列(FCS)。不破坏原来的数据。是cisco特有的技术。因此不能在cisco交换机和非Cisco交换机之间使用。
802.1q:在原有帧的源MAC地址字段后插入标记字段,同时用新的FCS字段代替了原有的FCS字段,该技术时国际标准,得到所有厂家的技术。
VLNA的优点:
1.控制网络的广播问题;每一个VLAN是一个广播域,一个VLAN上的广播不会扩散到另一个VLAN
2.简化网络管理:当VLAN中的用户位置移动时,网络管理员只需要设置几条命令即可;
3.提高网络的安全性;VLAN之间不能直接通信。

0

收藏

ljp0501

21篇文章,4W+人气,0粉丝

Ctrl+Enter 发布

发布

取消

f92360e227f9d91cdff7ea95120630ef.png
left-qr.jpg

扫一扫,领取大礼包

0

1
分享
qr-url?url=https%3A%2F%2Fblog.51cto.com%2Fljp0501%2F141913
ljp0501
noavatar_middle.gif