CISCO-端口聚合综合实验配置案例

CISCO-端口聚合实验配置案例

一、实验目的

  1. 学习如何配置 端口聚合
  2. 熟悉配置 端口聚合 的三种模式,并验证配置效果

二、实验内容

  1. 配置 cisco 私有 PAgP协 议的端口聚合,并验证效果
  2. 配置 IEEE 的 LACP 协议的端口聚合,并验证效果
  3. 配置 手动 链路聚合,并验证效果

1) 二层 PAgp链路聚合

image

① 端口加入端口聚合组

PAgP是通过数据到的交互进行的协商组成链路聚合,需将协议配置成对应的模式,端口就可以通过数据包协商链路聚合。

模式 desirable auto
desirable 匹配 匹配
auto 匹配 不匹配
  • SW1
Switch>enable
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#int range f0/1 -2
SW1(config-if-range)#channel-group 1 mode desirable 
SW1(config-if-range)#
Creating a port-channel interface Port-channel 1
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
  • SW2
Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SW2
SW2(config)#int range f0/1-2
SW2(config-if-range)#channel-group 1 mode auto
SW2(config-if-range)#
Creating a port-channel interface Port-channel 1
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

(可以尝试两端端口聚合号码配置不一致,看看能否成功协商)

② 验证端口聚合

  • 验证链路聚合
SW2#show etherchannel summary 
Flags:  D - down        P - in port-channel # 在端口聚合中
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2  # 二层
        U - in use # 正在使用     f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------
1      Po1(SU)           PAgP   Fa0/1(P) Fa0/2(P) 
  • 查看生成树,我们可以得知两条链路已通过链路聚合组成一条逻辑链路,并没有触发环路阻塞
SW2#show spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0060.47B7.8ED1
             Cost        9
             Port        27(Port-channel1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0060.7035.D93C
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------

Po1              Root FWD 9         128.27   Shr

2) 二层 LACP链路聚合

image

① 端口加入端口聚合组

LACP是通过数据到的交互进行的协商组成链路聚合,需将协议配置成对应的模式,端口就可以通过数据包协商链路聚合。

模式 desirable auto
active 匹配 匹配
passive 匹配 不匹配
  • SW1
Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#host SW1
SW1(config)#int range f0/1-2
SW1(config-if-range)#channel-group 1 mode active 
Creating a port-channel interface Port-channel 1
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
  • SW2
Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#host SW2
SW2(config)#int range f0/1-2
SW2(config-if-range)#channel-group 2 mode passive 
SW2(config-if-range)#
Creating a port-channel interface Port-channel 2
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

(通过实验验证,两端链路聚合号码不一致,也是可以成功协商的)

② 验证端口聚合

  • 验证链路聚合
SW1#show etherchannel summary 
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

1      Po1(SU)           LACP   Fa0/1(P) Fa0/2(P) 
  • 查看生成树,我们可以得知两条链路已通过链路聚合组成一条逻辑链路,并没有触发环路阻塞
SW1#show spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0060.47B7.8ED1
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0060.47B7.8ED1
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Po1              Desg FWD 9         128.27   Shr

2)手动 配置 链路聚合

image

① 端口加入端口聚合组

链路聚合的手动模式:指定是将两条链路强制绑定为一条逻辑链路,应用方向:一些三层设备比如路由器,没有二层端口不支持协议的协商,只能手动配置,但是如果对端为二层设备比如交换机,则需要设置成手动模式。

  • SW1
Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#host SW1
SW1(config)#int range f0/1 - 2
SW1(config-if-range)#channel-group 1 mode on
  • SW2
Switch>enable 
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int range f0/1-2
Switch(config-if-range)#channel-group 1 mode on

② 验证端口聚合

  • 验证链路聚合
SW1#show etherchannel summary 
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

1      Po1(SU)           -      Fa0/1(P) Fa0/2(P) 

隐藏:路由器对接交换机

image

  • SW1
WAN_ROUTER>enable 
WAN_ROUTER#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
WAN_ROUTER(config)#int port-channel 1
WAN_ROUTER(config-if)#exit
WAN_ROUTER(config)#int range gi0/0/0-1
WAN_ROUTER(config-if-range)#channel-group 1 
WAN_ROUTER(config-if-range)#no shut
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up
%LINK-5-CHANGED: Interface Port-channel1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
%LINK-5-CHANGED: Interface GigabitEthernet0/0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/1, changed state to up
WAN_ROUTER(config-if-range)#exit
WAN_ROUTER(config)#int po1
WAN_ROUTER(config-if)#ip add 1.1.1.1 255.0.0.0
  • SW2
L3_SW>enable 
L3_SW#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
L3_SW(config)#int range f0/1-2
L3_SW(config-if-range)#channel-group 1 mode on
L3_SW(config-if-range)#
Creating a port-channel interface Port-channel 1
%LINK-5-CHANGED: Interface Port-channel1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
L3_SW(config-if)#int po1
L3_SW(config-if)#no switchport 
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
L3_SW(config-if)#ip add 1.1.1.2 255.0.0.0
L3_SW(config-if)#do ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms

② 验证端口聚合

  • 交换机 - 验证链路聚合
L3_SW#show etherchannel summary 
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

1      Po1(RU)           -      Fa0/1(P) Fa0/2(P) 
  • 路由器 - 验证链路聚合
WAN_ROUTER#show ip int brief 
Interface              IP-Address      OK? Method Status                Protocol 
Port-channel1          1.1.1.1         YES manual up                    up 
GigabitEthernet0/0/0   unassigned      YES unset  up                    up 
GigabitEthernet0/0/1   unassigned      YES unset  up                    up 
Vlan1                  unassigned      YES unset  administratively down down
WAN_ROUTER#show interfaces port-channel 1
Port-channel1 is up, line protocol is up (connected)
  Hardware is EtherChannel, address is 0001.6455.00de (bia 0001.6455.00de)
  Internet address is 1.1.1.1/8
  MTU 1500 bytes, BW 2100000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Half-duplex, 2100Mb/s
  input flow-control is off, output flow-control is off
  Members in this channel: Gig0/0/0 ,Gig0/0/1 ,
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     956 packets input, 193351 bytes, 0 no buffer
     Received 956 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     2357 packets output, 263570 bytes, 0 underruns
     0 output errors, 0 collisions, 10 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
posted @ 2023-02-16 11:04  plengong  阅读(1140)  评论(1编辑  收藏  举报