分享

思科三层交换3560配置VTP | 168yeah博客

 milo2008 2014-07-22
科三层交换3560配置VTP
2013年06月11日 ? 思科 ? 暂无评论 ? 被围观 1,063 views+

说明:如图

将Switch A 配置成VTP-Server,并创建Vlan2、Vlan3、Vlan4

将Switch B 配置成VTP-Client

将Switch C 配置成VTP-Transparent

关于VTP的这三种模式,可以自行百度~

 

Switch A 配置:

Switch>

Switch>en

Switch#conf t

Switch(config)#hostname VTP-Server

VTP-Server (config)#exit

VTP-Server#vtp database

VTP-Server(vlan)#vtp server

Device mode already VTP SERVER.

VTP-Server(vlan)#vtp domain hunter

Changing VTP domain name from NULL to hunter

VTP-Server(vlan)#vtp password 123

Setting device VLAN database password to 123

VTP-Server(vlan)#exit

VTP-Server#conf t

VTP-Server#interface f0/1

VTP-Server(config-if)#switchport trunk encapsulation dot1q

VTP-Server(config-if)#switchport mode trunk

VTP-Server#interface f0/2

VTP-Server(config-if)#switchport trunk encapsulation dot1q

VTP-Server(config-if)#switchport mode trunk

VTP-Server(config-if)#exit

VTP-Server(config)#exit

VTP-Server#show run

 

hostname VTP-Server

interface FastEthernet0/1

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/2

switchport trunk encapsulation dot1q

switchport mode trunk

 

Switch B 配置:

Switch>

Switch>en

Switch#conf t

Switch(config)#hostname VTP-Client

VTP-Client (config)#exit

VTP-Client (config)#vlan database

VTP-Client(vlan)#vtp client

Setting device to VTP CLIENT mode.

VTP-Client(vlan)#vtp domain hunter

Changing VTP domain name from NULL to hunter

VTP-Client(vlan)#vtp password 123

Setting device VLAN database password to 123

VTP-Client(vlan)#exit

VTP-Client#en

VTP-Client#conf t

VTP-Client(config)#interface f0/1

VTP-Client(config-if)#switchport mode trunk

 

 

Switch C 配置:

 

 

Switch>

Switch>en

Switch#conf t

Switch(config)#hostname VTP-Client

VTP- Transparent (config)#exit

VTP- Transparent (config)#vlan database

VTP-Transparent(vlan)#vtp transparent

Setting device to VTP TRANSPARENT mode.

VTP-Transparent(vlan)#exit

VTP-Transparent#conf t

VTP-Transparent(config)#inter f0/2

VTP-Transparent(config-if)#switchport mode trunk

VTP-Transparent(config-if)#exit

 

 

以上配置完成后,在VTP-Server交换机上创建VLAN2 VLAN3 VLAN4

然后在交换机VTP-Client上show run,发现创建的3个vlan已经同步过来了。

VTP-Client#show vlan

 

VLAN Name                             Status    Ports

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

1    default                          active    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/14, Fa0/15, Fa0/16, Fa0/17

Fa0/18, Fa0/19, Fa0/20, Fa0/21

Fa0/22, Fa0/23, Fa0/24, Gig1/1

Gig1/2

2    VLAN0002                         active

3    VLAN0003                         active

4    VLAN0004                         active

1002 fddi-default                     act/unsup

1003 token-ring-default               act/unsup

1004 fddinet-default                  act/unsup

1005 trnet-default                    act/unsup

 

此时我们在VTP-Server上show vtp status

VTP-Server#show vtp status

VTP Version                     : 2

Configuration Revision          : 3

Maximum VLANs supported locally : 1005

Number of existing VLANs        : 8

VTP Operating Mode              : Server

VTP Domain Name                 : hunter

VTP Pruning Mode                : Disabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0x3D 0xCA 0x42 0x0E 0xFA 0x7F0x13 0xA3

Configuration last modified by0.0.0.0 at 3-1-93 00:07:33

Local updater ID is0.0.0.0 (no valid interface found)

 

此时我们在VTP-Server上再创建个vlan5,然后show vtp status,发现Configuration Revision由3变成了4,下面请看下面详解

VTP-Server#show vtp status

VTP Version                     : 2  【设备支持的vtp版本为2】

Configuration Revision          : 4     【目前的配置修改编号的4,随着配置修改会增加】

Maximum VLANs supported locally : 1005 【支持最大的VLAN为1005个】

Number of existing VLANs        : 9

VTP Operating Mode              : Server 【vtp 模式为server】

VTP Domain Name                 : hunter 【vtp域名为hunter】

VTP Pruning Mode                : Disabled 【未启用vtp修剪功能】

VTP V2 Mode                     : Disabled 【未使用VTP v2版本】

VTP Traps Generation            : Disabled

【默认禁用,若开启后,每当一个新的VTP消息发送。它会导致一个SNMP消息被生成】

MD5 digest                      : 0x60 0xDD 0x3F0x4B 0x2A0x4C0xCB 0x6E

Configuration last modified by0.0.0.0 at 3-1-93 00:17:06【更新时间】

Local updater ID is0.0.0.0 (no valid interface found) 【更新者为0.0.0.0,由于接口没有配置IP,若配置后这里会显示IP地址】

 

下面在VTP-Transparent上show vtp status,会发现没有增加任何VLAN,这就对了。呵呵。

VTP-Transparent#show vtp status

VTP Version                     : 2

Configuration Revision          : 0

Maximum VLANs supported locally : 255

Number of existing VLANs        : 5

VTP Operating Mode              : Transparent

VTP Domain Name                 :

VTP Pruning Mode                : Disabled

VTP V2 Mode                     : Disabled

VTP Traps Generation            : Disabled

MD5 digest                      : 0x7D 0x5A0xA6 0x0E 0x9A0x72 0xA0 0x3A

Configuration last modified by0.0.0.0 at 0-0-00 00:00:00

 

VTP-Transparent上show vlan

 

VTP-Transparent#show vlan

 

VLAN Name                             Status    Ports

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

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

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

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

Fa0/14, Fa0/15, Fa0/16, Fa0/17

Fa0/18, Fa0/19, Fa0/20, Fa0/21

Fa0/22, Fa0/23, Fa0/24, Gig1/1

Gig1/2

1002 fddi-default                     act/unsup

1003 token-ring-default               act/unsup

1004 fddinet-default                  act/unsup

1005 trnet-default                    act/unsup

 

 

最后一步,VTP 修剪,关于功能,自行百度~

由于所使用的思科模拟器不支持vtp修剪,所以只贴出以下命令,只做参考。

配置方法一:所有VLAN都启用VTP 修剪

VTP-Server >

VTP-Server >en

VTP-Server #conf t

VTP-Server (config)#vtp prunning

 

配置方法二:只对vlan 2-5 启用VTP修剪

VTP-Server >

VTP-Server >en

VTP-Server #conf t

Enter configuration commands, one per line.  End with CNTL/Z.

VTP-Server (config)#interface f0/1

VTP-Server (config-if)#switchport trunk prunning vlan 2-5

VTP-Server (config-if)#switchport trunk pruning vlan remove 3 (在中继中去除vlan3的修剪)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多