VLAN-VTP-Trunk(二)

配置举例:
SW1(f1/1)--------(f1/1)SW3

(f1/4) (f1/5)

\ /

\ /

\ /

(f1/4)SW2(f1/5)

SW1的配置:

SW1#sh run int f1/1
Building configuration...

Current configuration : 71 bytes
!
interface FastEthernet1/1
switchport mode trunk
no ip address
end

SW1#sh run int f1/4
Building configuration...

Current configuration : 71 bytes
!
interface FastEthernet1/4
switchport mode trunk
no ip address
end

SW1#sh vlan bri

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa1/0, Fa1/2, Fa1/3, Fa1/5
Fa1/6, Fa1/7, Fa1/8, Fa1/9
Fa1/10, Fa1/11, Fa1/12, Fa1/13
Fa1/14, Fa1/15
10 10 active
20 20 active
30 30 active

1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
SW1#sh vtp st
VTP Version : 2
Configuration Revision : 1
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Server
VTP Domain Name : WOLF

VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xC7 0x1A 0x58 0x1F 0x37 0xDD 0xF2 0x08
Configuration last modified by 0.0.0.0 at 3-1-02 00:03:49
Local updater ID is 0.0.0.0 (no valid interface found)

SW2的配置:

SW2#sh run int f1/5
Building configuration...

Current configuration : 71 bytes
!
interface FastEthernet1/5
switchport mode trunk
no ip address
end

SW2#sh vtp st
VTP Version : 2
Configuration Revision : 1
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Client
VTP Domain Name : WOLF

VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xC7 0x1A 0x58 0x1F 0x37 0xDD 0xF2 0x08
Configuration last modified by 0.0.0.0 at 3-1-02 00:03:49
SW2#sh vlan-s bri

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa1/0, Fa1/1, Fa1/2, Fa1/3
Fa1/6, Fa1/7, Fa1/8, Fa1/9
Fa1/10, Fa1/11, Fa1/12, Fa1/13
Fa1/14, Fa1/15
10 10 active
20 20 active
30 30 active

1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

SW3的配置:

SW3#sh vlan-s bri

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa1/0, Fa1/2, Fa1/3, Fa1/4
Fa1/6, Fa1/7, Fa1/8, Fa1/9
Fa1/10, Fa1/11, Fa1/12, Fa1/13
Fa1/14, Fa1/15
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
SW3#sh run int f1/1
Building configuration...

Current configuration : 71 bytes
!
interface FastEthernet1/1
switchport mode trunk
no ip address
end
SW3#sh vtp st
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 256
Number of existing VLANs : 5
VTP Operating Mode : Transparent
VTP Domain Name : WOLF

VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x53 0x41 0xF5 0xED 0xA9 0x51 0x4D 0xAC
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00

<VTP Pruning>

·VTP修剪能够确定Trunk何时正在扩散不必要的流量。并将其VLAN修剪掉。
在Server端配置,其他SW会学习到。

SW1的配置:

SW1(vlan)#vtp pruning
Pruning switched ON
SW1(vlan)#exi
APPLY completed.
Exiting....
SW1#sh vtp st
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Server
VTP Domain Name : WOLF
VTP Pruning Mode : Enabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xB8 0x26 0x2B 0x60 0xFC 0x58 0xFF 0xCD
Configuration last modified by 0.0.0.0 at 3-1-02 00:15:42
Local updater ID is 0.0.0.0 (no valid interface found)

看一看SW2情况:

SW2#sh vtp st
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 256
Number of existing VLANs : 8
VTP Operating Mode : Client
VTP Domain Name : WOLF
VTP Pruning Mode : Enabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xB8 0x26 0x2B 0x60 0xFC 0x58 0xFF 0xCD
Configuration last modified by 0.0.0.0 at 3-1-02 00:15:42

·VTP版本:(V1/V2/V3)
 默认是V1。Cisco 建议一个域中版本一致。

Sw1(config)#vtp version 2

Sw3#vlan database
Sw3(vlan)#vtp v2-mode

·VTP认证:

Sw2(config)#vtp password aaa

Sw3#vlan database
Sw3(vlan)#vtp password aaa

如何检查密码相同/不同:
Sw2#show vtp password

SWITCH常用配置命令
Sw1#show cdp neighbors detail 查看邻居设备
Show mac-address-table 查看MAC地址
Show mac-address-table aging-time 看MAC地址老化时间
Sw1(config)#mac-address-table aging-time 150 vlan 10修改老化时间

创建VLAN
Sw1(config)#vlan 10
Sw1(config)#name sales
在2900等旧机型上要用数据库模式来创建:
Sw1#vlan database
Sw1#vlan 10 name sales
Sw1#exit 这里一定要用exit,否则无法退出
Show vlan 查看VLAN
Show vlan brief 查看VLAN摘要信息
Show interface summary 本命令可看到交换机上的所有端口,以及哪些接口上连有设备
Show interface status 本命令可看到活动接口的双工模式,trunk,以及接口属于哪个VLAN

将端口划进VLAN
Int f0/12
Switchport mode access 指定为access(接入口)模式
Switchport access valn 10 划分入VLAN
Intferface range f0/5,f0/7,f0/12 同时划分多个端口
Intferface range fastethernet 0/5 - 8,fastethernet 0/12 - 18
本台交换机起Trunk
Int f0/24
Switchport mode trunk 强制起Trunk
Access 强制为接入口
Dynamic desirable 协商(默认)
Dynamic auto 被动接受
Switchport trunk encapsulation isl(dot1q|negotiate)封装模式,如果使用negotiate参数表示协商
Sw1(config-if)#switchport nonegotiate 本接口不发送协商信息,通常和trunk模式联用
Switchport trunk native vlan 10 设置一个不用打TAG的VLAN,大家都知道,在每台交换机上都要一致,默认是VLAN1。
Switchport trunk allowed vlan 10 允许trunk口通过哪些VLAN
Switchport trunk allowed all 允许所有VLAN通过
Show interface trunk
Show int f0/24 switchport

配置VTP域
Sw1(config)#vtp domain china
Sw1(config)#vtp mode server|client|transparent
在旧机型上的配置方法:
Sw1#vlan database
Sw1#vtp domain china
Sw1#vtp server|client|transparent
Show vtp status 查看VTP的各种配置信息
在VTP中还可设置密码

在三层交换机中完成VLAN间的通信
Sw1(config)#ip routing 起用路由
Sw1(config)#router rip 开启路由进程,也可用静态路由
Sw1(config-router)#network 100.1.1.0 将VLAN网段宣告
Sw1(config)#interface vlan 100
Sw1(config-if)#ip address 100.1.1.1 指定VLAN的IP地址,也是VLAN网段的网关
Sw1(config-if)#no shutdown

在交换机中建立VLAN后,会在FLASH中生成一个VLAN文件,可用下列命令查看、删除。
Show flash
Delete vlan.dat
Delete config.text 删除配置文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值