天天看點

在2950交換機上配置VTP

在2950交換機上配置VTP

SW1配置:

SW1#conf t

SW1(config)#int f0/14

SW1(config-if)#switchport mode trunk

SW1(config-if)#end

SW1#vlan database

SW1(vlan)#vtp server

SW1(vlan)#vtp domain sy

SW1(vlan)#vtp password cisco

SW1(vlan)#vtp pruning

SW1(vlan)#exit

SW1(vlan)#vlan 2

SW1(vlan)#vlan 3

SW1(config)#int vlan 1

SW1(config-if)#ip address 192.168.1.1 255.255.255.0

SW1(config-if)#no shutdown

SW1(config-if)#exit

SW1(config)#int f0/2

SW1(config-if)#switchport access vlan 2

SW1(config)#int f0/3

SW1(config-if)#switchport access vlan 3

SW1#show vtp status

VTP Version                     : 2

Configuration Revision          : 4

Maximum VLANs supported locally : 256

Number of existing VLANs        : 7

VTP Operating Mode              : Server

VTP Domain Name                 : sy

VTP Pruning Mode                : Enabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0x6D 0xEC 0x95 0x75 0xF9 0x33 0x11 0x2F

Configuration last modified by 192.168.1.1 at 3-1-02 00:09:20

Local updater ID is 192.168.1.1 on interface Vl1 (lowest numbered VLAN interface found)

SW1#show vlan-switch brief

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/0, Fa0/1, Fa0/4, Fa0/5

                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9

                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13

                                                Fa0/15

2    VLAN0002                         active    Fa0/2

3    VLAN0003                         active    Fa0/3

1002 fddi-default                     active   

1003 token-ring-default               active   

1004 fddinet-default                  active   

1005 trnet-default                    active

SW2配置:

SW2#conf t

SW2(config)#int range f0/14 - 15

SW2(config-if-range)#switchport mode trunk

SW2(config-if-range)#end

SW2#vlan database

SW2(vlan)#vtp transparent

SW2(vlan)#vtp domain sy

SW2(vlan)#vtp password cisco

SW2(vlan)#exit       

SW2(vlan)#vlan 4

SW2(vlan)#vlan 5

SW2(vlan)#exit

SW2(config)#int f0/2

SW2(config-if)#switchport access vlan 4

SW2(config-if)#exit

SW2(config)#int f0/3

SW2(config-if)#switchport access vlan 5

SW2(config-if)#end

SW2#show vtp status

Configuration Revision          : 0

VTP Operating Mode              : Transparent

VTP Pruning Mode                : Disabled

MD5 digest                      : 0x0A 0xD6 0x8D 0xF1 0x4B 0xDC 0xB1 0xAB

Configuration last modified by 0.0.0.0 at 3-1-02 00:04:57

SW2#show vlan-switch brief

4    VLAN0004                         active    Fa0/2

5    VLAN0005                         active    Fa0/3

SW3配置:

SW3#conf t

SW3(config)#int f0/15

SW3(config-if)#switchport mode trunk

SW3(config-if)#end

SW3#vlan database

SW3(vlan)#vtp client

SW3(vlan)#vtp domain sy

SW3(vlan)#vtp password cisco

SW3(vlan)#exit

SW3#show vtp status

VTP Operating Mode              : Client

SW3(config)#int f0/2

SW3(config-if)#switchport access vlan 2

SW3(config-if)#exit

SW3(config)#int f0/3

SW3(config-if)#switchport access vlan 3

SW3#show vlan-switch brief

                                                Fa0/14

客戶機配置:

PC1:

屬于vlan2成員,與SW1的F0/2口相連

IP:10.0.0.1/24

PC2:

屬于VLAN2成員,與SW3的F0/2口相連

IP:10.0.0.2/24

測試:

PC1#ping 10.0.0.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 72/140/192 ms

總結:

transparent(透明)模式可以轉發同一域名下的VTP資訊(vtp version 1),但不學習VTP資訊。可以建立、删除、修改VLAN,但隻在本地有效。透明模式在VTP VERSION 2下可以轉發不同域名的VTP資訊。

繼續閱讀