chaosxin 发表于 2018-7-15 10:12:38

Cisco6509三层交换机的通道配置

对线上交换机进行配置修改,出现交换机暂时断网.原有情况:  2台交换机通过2对光纤连接,分别作上port-channel,并将交换机的相应端口绑定在po上,启用trunk模式.交换机上原有几个vlan,但是在这个Po上只允许vlan21通过.如:
  上联交换机A部分配置:
  interface Port-channel1
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 21
  switchport mode trunk
  !
  interface GigabitEthernet1/0/3
  description to-YH06050001_g1/0/25
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 21
  switchport mode trunk
  channel-group 1 mode on
  !
  interface GigabitEthernet1/0/4
  description to-YH06050001_g1/0/26
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 21
  switchport mode trunk
  channel-group 1 mode on
  !
  下联交换机B部分配置:
  interface Port-channel1
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 21
  switchport mode trunk
  !
  interface GigabitEthernet1/0/25
  description to-CN_3523_g1/0/3
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 21
  switchport mode trunk
  udld port
  channel-group 1 mode on
  !
  interface GigabitEthernet1/0/26
  description to-CN_3523_g1/0/4
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 21
  switchport mode trunk
  channel-group 1 mode on
  !
  现在在这2个交换机上分别新建一个vlan254,并且需要在它们之间互通vlan254.于是在分别建立vlan254后,在A上作如下配置:
  int port-channel 1
  switchport trunk allow vlan add 254
  int range g1/0/3 -4
  switchport trunk allow vlan add 254
  然后在交换机B上作如下配置:
  int range g1/0/25 -26
  switchport trunk allow vlan add 254
  此时出现交换机B立即断网,于是马上进机房察看交换机这2个端口的状态灯发现显示沉黄色.console登陆,删除这一配置,端口才up.查看log发现:vlan mask is not matching.因为po上还没有进行配置.然后进行如下配置:
  int port-channel 1
  switchport trunk allow vlan add 254
  此时sh run,发现
  int range g1/0/25 -26
  switchport trunk allow vlan add 254
  这2个端口竟然自动配置上了vlan254.
  于是另外再做实验,对于没有做po的端口,可以直接加类似 switchport trunk allow vlan add 254 这样的配置.
经验总结:  对trunk链路进行添加vlan配置时:
  1,对于物理trunk端口绑定在逻辑端口port-channel的情况,需要先对逻辑端口进行配置,这样的配置可以自动配置到物理链路上.(扩充:是否所有对于物理链路的配置都可以先在逻辑链路上配置,且自动配置在相应的物理链路上呢?)
  2,对于直接物理链路(没有绑定在逻辑链路上)的情况,可以直接对物理链路进行 switchport trunk allow vlan add 254 类似配置.
本文出自 51CTO.COM技术博客
页: [1]
查看完整版本: Cisco6509三层交换机的通道配置