网络通信 频道

配置示例:Catalyst 2900XL/3500XL/2950

介绍

本文提供Cisco Catalyst 5500与Catalyst 3500XL交换机之间InterSwitch Link (ISL)和802.1q中继的配置示例,执行命令时显示每个命令的结果。为了获得相同的结果,可在本文所说明的方案中使用Cisco Catalyst 4000和6000(运行CatOS)系列交换机或Catalyst 5000系列中的其他交换 机以及任何 Catalyst 2900XL、3500XL或2950交换机。

所使用组件

在本文的示例中,我们在实验室环境中使用以下交换机和清除(缺省)配置:

  • 运行Cisco IOS 12.0(5.x)XU的Catalyst 3524XL交换机

  • 运行Catalyst OS 5.5(3)软件的Catalyst 5500交换机

本文所包含的信息基于特定 实验室环境 中的设备。 在使用任何配置或命令之前,您必须确保由此可能对网络带来的潜在影响。所有设备上的配置通过 clear config allwrite erase 命令来清除,从而确保默认配置。

基础理论

中继是在两个设备之间点到点链路传输来自若干 VLAN的业务的一种方式。 执行以太网中继的方法有如下两种:

  • ISL (Cisco 专有 InterSwitch 链路协议)

  • 802.1q (电气电子工程师协会 (IEEE) 标准)

我们将建立一条中继,通过 Catalyst 3500 和 Catalyst 5500 交换机之间的单一链路来传输来自2个VLAN (VLAN 1 和 VLAN 2) 的业务。如何在2个VLAN 之间选路由不属于本文讨论范围。

重要提示

对于 Catalyst 2900XL/3500XL/2950 交换机:

Catalyst 2950 系列交换机只支持802.1q中继,而不支持ISL中继。

Catalyst 2900XL/3500XL 交换机目前不支持动态中继协议 (DTP)。 因此,我们建议在中继链路的 other(另一端) 使用 nonegotiate 选项,如同 Catalyst 4000、5000 和 6000 交换机上的配置一样。这样,XL 交换机端口就不会接收不熟悉的 DTP 帧。

在 4MB DRAM Catalyst 2900XL 交换机上,只有配备以下具有中继功能的模块时才支持中继:

  • WS-X2914-XL-V

  • WS-X2922-XL-V

  • WS-X2924-XL-V

  • WS-X2931-XL

  • WS-X2932-XL

有关当前支持中继的交换型号,请参阅下表:

交换机型号

ISL中继所要求的最低版本

IEEE802.1q中继所要求的最低版本

中继(ISL/802.1q )所要求的当前版本

WS-C2916M-XL (4-Meg Switch)

11.2(8)SA4 (企业版)

11.2(8)SA5 (原始版本)

11.2(8.6)SA6 (原始版本)

WS-C2912-XL

11.2(8)SA4 (企业版)

11.2(8)SA5 (原始版本)

12.0(5)WC(1) 或更高版本

WS-C2924-XL

11.2(8)SA4 (企业版)

11.2(8)SA5 (原始版本)

12.0(5)WC(1) 或更高版本

WS-C2924C-XL

11.2(8)SA4 (Enterprise Edition)

11.2(8)SA5 (企业版)

12.0(5)WC(1) 或更高版本

WS-C2924M-XL

11.2(8)SA4 (企业版)

11.2(8)SA5 (原始版本)

12.0(5)WC(1) 或更高版本

WS-C2912MF-XL

11.2(8)SA4 (企业版)

11.2(8)SA5 (原始版本)

12.0(5)WC(1) 或更高版本

WS-C2924M-XL-DC

12.0(5)XU

12.0(5)XU

12.0(5)WC(1) 或更高版本

WS-C3508G-XL

11.2(8)SA4 (Enterprise Edition)

11.2(8)SA5 (企业版)

12.0(5)WC(1) 或更高版本

WS-C3512-XL

11.2(8)SA4 (企业版)

11.2(8)SA5 (原始版本)

12.0(5)WC(1) or later

WS-C3524-XL

11.2(8)SA4 (企业版)

11.2(8)SA5 (原始版本)

12.0(5)WC(1) 或更高版本

WS-C3548-XL

12.0(5)XP (企业版)

12.0(5)XP (企业版)

12.0(5)WC(1) 或更高版本

WS-C3524-PWR-XL

12.0(5)XU

12.0(5)XU

12.0(5)WC(1) 或更高版本

WS-C3524-PWR-XL

12.0(5)XU

12.0(5)XU

12.0(5)WC(1) 或更高版本

WS-C2950-12

不支持ISL

12.0(5)WC(1)

802.1Q 要求12.0(5)WC(1)或更高版本,不支持ISL

WS-C2950-24

不支持ISL

12.0(5)WC(1)

802.1Q 要求12.0(5)WC(1)或更高版本,不支持ISL

WS-C2950C-24

不支持ISL

12.0(5)WC(1)

802.1Q要求12.0(5)WC(1)或更高版本,不支持ISL

WS-C2950T-24

不支持ISL

12.0(5)WC(1)

802.1Q要求12.0(5)WC(1)或更高版本,不支持ISL

注意:?/B>在上表中,只有WS-C2916M-XL是4MB DRAM交换机。所列的所有其他交换机均为8MB DRAM 交换机。若要确定您的交换机的DRAM4为MB还是8 MB,请输入用户级 show version 命令。 有关更多信息,请参阅: 使用命令行界面(CLI)升级Catalyst 2900-XL/3500-XL 交换机软件 (CLI)一文的"如何通过命令行界面确定交换机内存容量"部分。

[page]

对于 Catalyst 4000, 5000, 6000 交换机:

  • Catalyst 4000系列(包括Catalyst 2948G和Catalyst 2980G)只支持802.1q中继,而不支持ISL中继。

  • Catalyst 6000系列交换机上的任何以太网端口支持802.1q或ISL封装。

  • 具有中继能力的Catalyst 5000端口根据模块的不同只支持ISL封装或ISL和802.1q中的任意一个。检查这一项的非常好的办法是使用 show port capabilities 命令;中继容量是明确规定的,例如:

    cat5509 show port capabilities 3
     Model                    WS-X5234
     Port                     3/1
     Type                     10/100BaseTX
     Speed                    auto,10,100
     Duplex                   half,full
     Trunk encap type         802.1Q,ISL
     
     !-- 该端口支持802.1Q 和ISL.
     
     Trunk mode               on,off,desirable,auto,nonegotiate
     Channel                  3/1-2,3/1-4 
     Broadcast suppression    percentage(0-100)
     Flow control             receive-(off,on),send-(off,on)
     Security                 yes
     Membership               static,dynamic
     Fast start               yes
     QOS scheduling           rx-(none),tx-(1q4t)
     CoS rewrite              yes
     ToS rewrite              IP-Precedence
     Rewrite                  yes
     UDLD                     yes
     AuxiliaryVlan            1..1000,untagged,dot1p,none
     SPAN                     source,destination
     
  • 确保整个中继链路范围内的中继模式匹配。若链路的一端配置为ISL中继,则链路的另一端也应配置为ISL;同样,若链路的一端配置为802.1q,则链路的另一端也要配置为802.1q。

配置

本节说明如何配置本文描述的各种特性。

注意:?/B>若要了解有关本文中所使用命令的更多信息,请使用 Command Lookup 工具。

网络图

本文使用下图所示的网络设置。

43a.gif

配置

以下配置适用于这些交换机:

  • 为交换机分配的名称

  • 在交换机上设置的口令

  • 通过快速以太网链路连接的交换机

  • 只为了便于管理而向交换机分配的IP 地址

  • 交换机上设置的VLAN 中继协议 (VTP) 模式

  • 交换机上添加第二个 VLAN (VLAN 2) ;在这些 VLAN 上添加端口

  • 在连接工作站的端口上激活Spanning-tree portfast (生成树 portfast),根据拓扑结构,启用Catalyst 5500 上端口 2/2, 2/3上的Spanning-tree portfast,以及Catalyst 3524XL上端口FastEthernet0/2 和端口FastEthernet0/3 上的Spanning-tree portfast

注意:?/B>下面屏幕内容显示了在3524XL 交换机上输入的命令。命令之间的评语以 blue italics(兰色斜体字) 添加进去的,以解释特定命令和步骤:

Catalyst 3524-XL

 
 !--- 设置特权模式 
 !--- 和交换机的Telnet口令
 
 
 switch#configure terminal
 Enter configuration commands, one per line..End with CNTL/Z.
 switch(config)#hostname 3524xl
 3524xl(config)#enable password mysecret
 3524xl(config)#line vty 0 4
 3524xl(config-line)#login
 3524xl(config-line)#password mysecret
 3524xl(config-line)#exit
 3524xl(config)#no logging console
 3524xl(config)#^Z
 
 
 !--- 为了管理,设置Vlan 1 的IP地址。
 
 
 3524xl#configure terminal
 Enter configuration commands, one per line. End with CNTL/Z.
 3524xl(config)#int vlan 1
 3524xl(config-if)#ip address 10.10.10.2 255.255.255.0
 3524xl(config-if)#end
 
 
 !--- 设置VTP 模式。
 !--- 本例中,我们将该模式设置为透明。
 !--- 根据您的网络来设置相应的VTP模式。
 !--- VTP的详细信息,请参考以下文件:
 !--- 在Catalyst 2900XL和3500XL交换机上配置VTP、VLANs和VLAN中继 
 
 
 3524xl#vlan database
 3524xl(vlan)#vtp transparent
 Setting device to VTP TRANSPARENT mode.
 
 
 !--- 正在添加Vlan 2
 
 3524xl(vlan)#vlan 2
 VLAN 2 added:
 Name: VLAN0002
 3524xl(vlan)#exit
 APPLY completed.
 Exiting....
 
 
 !--- 激活快速以太网接口 0/1上的中继.
 
 3524xl#configure terminal
 Enter configuration commands, one per line. End with CNTL/Z.
 3524xl(config)#int fastEthernet 0/1
 3524xl(config-if)#switchport mode trunk
 
 
 !--- 输入isl 或dot1q中继封装。
 
 
 3524xl(config-if)#switchport trunk encapsulation isl
 3524xl(config-if)#switchport trunk encapsulation dot1q
 
 
 !--- 在2950交换机中不能使用上述两个 switchport 命令。
 !--- 2950交换机只支持802.1q封装,使用switchport mode trunk
 !--- 命令激活接口上的中继之后,该封装将被自动配置。
 
 
 !---在dot1q封装中,您需要确保
 !--- 本地VLAN与该链路匹配。
 !--- 对于3524XL,默认情况下其本地VLAN为1。
 !--- 根据网络需要,您可以将
 !--- 本地VLAN改成其它的VLAN,
 !--- 不过,重要的是您必须在链路的另一端
 !--- 相应地更改本地VLAN(本例中是cat5509)。
 !--- 如果需要的话,您可以通过使用以下命令来更改本地VLAN:
 !--- 3524xl(config-if)#switchport trunk native vlan <vlan ID> .
 
 
 
 
 !--- 支持中继线上的所有VLAN
 
 3524xl(config-if)#switchport trunk allowed vlan all
 3524xl(config-if)#exit
 
 
 !--- 以下这套命令将把FastEthernet 0/2接口 0/2 
 !--- 分配给vlan 2,并激活接口上的快速端口。
 
 
 3524xl(config)#int fastEthernet 0/2
 3524xl(config-if)#switchport access vlan 2
 3524xl(config-if)#spanning-tree portfast
 3524xl(config-if)#exit
 3524xl(config)#int fastEthernet 0/3
 3524xl(config-if)#spanning-tree portfast
 3524xl(config-if)#^Z
 
 
 !-- 在关 如何激活快速端口的详细信息, 
 !--- 请参考:使用 Portfast 和其它命令来解决工作站启动连接延迟问题
 !--- 请记住保存配置 
 !--- (您不必在CatOS 交换机上保存配置)。
 
 
 3524xl#write memory
 Building configuration...
 
 3524xl#
 
 3524xl#show running-config
 Building configuration...
 
 Current configuration:
 
 !
 version 12.0
 no service pad
 service timestamps debug uptime
 service timestamps log uptime
 no service password-encryption
 !
 hostname 3524xl
 !
 no logging console
 enable password mysecret
 !
 !
 !
 !
 !
 ip subnet-zero
 !
 !
 !
 interface FastEthernet0/1
 switchport mode trunk
 !
 
 !--- 如果配置的是802.1q, 
 !--- 那么您将在FastEthernet0/1接口上 
 !--- 看到以下输出:
 !--- interface FastEthernet0/1
 !--- switchport trunk encapsulation dot1q
 !--- switchport mode trunk
 
 
 
 !
 interface FastEthernet0/2
 switchport access vlan 2
 spanning-tree portfast
 !
 interface FastEthernet0/3
 spanning-tree portfast
 !
 interface FastEthernet0/4
 !
 interface FastEthernet0/5
 !
 interface FastEthernet0/6
 !
 interface FastEthernet0/7
 !
 interface FastEthernet0/8
 !
 interface FastEthernet0/9
 !
 interface FastEthernet0/10
 !
 interface FastEthernet0/11
 !
 interface FastEthernet0/12
 !
 interface FastEthernet0/13
 !
 interface FastEthernet0/14
 !
 interface FastEthernet0/15
 !
 interface FastEthernet0/16
 !
 interface FastEthernet0/17
 !
 interface FastEthernet0/18
 !
 interface FastEthernet0/19
 !
 interface FastEthernet0/20
 !
 interface FastEthernet0/21
 !
 interface FastEthernet0/22
 !
 interface FastEthernet0/23
 !
 interface FastEthernet0/24
 !
 interface GigabitEthernet0/1
 !
 interface GigabitEthernet0/2
 !
 interface VLAN1
 ip address 10.10.10.2 255.255.255.0
 no ip directed-broadcast
 no ip route-cache
 !
 !
 line con 0
 transport input none
 stopbits 1
 line vty 0 4
 password mysecret
 login
 line vty 5 15
 login
 !
 end
 
 

注意:?/B>以下屏幕内容显示了在5500交换机上输入的命令。为了说明某些命令和步骤,在命令之间用兰色斜体字添加了评语。

Catalyst 5500

 
 !--- 设置交换机的系统名称和口令。
 
 Console> (enable) set system name cat5509
 System name set.
 cat5509> (enable) set password
 Enter old password:
 Enter new password:
 Retype new password:
 Password changed.
 cat5509> (enable) set enablepass
 Enter old password:
 Enter new password:
 Retype new password:
 Password changed.
 
 
 !--- 给交换机分配IP地址。

0
相关文章