何为端口聚合:
端口汇聚是一种逻辑上的抽象过程,将一组具备相同属性的端口,抽象成一个逻辑端口。
对用户来讲,完全可以将这个port channel 当作一个端口使用,因此不仅能增加网络的带宽,还能提供链路的备份功能。
端口聚合分类:
分为2类.一类为2层的port-channel.一类为3层的
2层的port-channel只需要配physical interface就行了,可以是static access,也可以使trunk,但是必须一样。不需要create port-channel。
3层的port-channel要首先create port-channel,然后no switchport把port-channel变成L3 interface,加上IP地址。再进入physical interface,必须no ip address去掉physical interface的IP信息,然后直接channel-group加入EtherChannel就行了。
为使port channel 正常工作,port channel 的成员端口必须具备以下相同的属性:
1 端口均为全双工模式;
2 端口速率相同;
3 端口的类型必须一样,比如同为以太口或同为光纤口;
4 端口同为access 端口并且属于同一个vlan 或同为trunk 端口;
5 如果端口为trunk 端口,则其allowed vlan 和native vlan 属性也应该相同。
cisco example:
For L2 static access EtherChannel:
Switch# configure terminal
Switch(config)# interface range gigabitethernet0/1 -2
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# channel-group 5 mode on
Switch(config-if-range)# end
For L2 trunk EtherChannel:
Switch# configure terminal
Switch(config)# interface range gigabitethernet0/1 -2
Switch(config-if-range)# switchport trunk encapsulation dot1q
Switch(config-if-range)# switchport mode trunk
Switch(config-if-range)# channel-group 1 mode on
Switch(config-if-range)# end
For L3 EtherChannel:
Switch# configure terminal
Switch(config)# interface port-channel 5
Switch(config-if)# no switchport
Switch(config-if)# ip address 172.10.20.10 255.255.255.0
Switch(config-if)# interface range gigabitethernet0/1 -2
Switch(config-if-range)# no ip address
Switch(config-if-range)# channel-group 5 mode on
Switch(config-if-range)# end
interface Port-channel1
switchport access vlan 121
switchport mode access
spanning-tree portfast
interface Port-channel4
switchport trunk encapsulation dot1q
switchport mode trunk
juniper 配置实例:
将2个端口聚合到ae1 ae1为trunk 模式
SRX设备Reth接口的聚合配置:
SRX Config:
set interfaces ge-3/0/0 gigether-options redundant-parent reth1
set interfaces ge-3/0/1 gigether-options redundant-parent reth1
set interfaces ge-15/0/0 gigether-options redundant-parent reth1
set interfaces ge-15/0/1 gigether-options redundant-parent reth1
set interfaces reth1 redundant-ether-options redundancy-group 1
set interfaces reth1 redundant-ether-options lacp passive