目录
————————————————————————————————————————————————————————
- sw1(config)#int f0/3
- sw1(config-if)#switchport trunk native vlan 2 ——修改 native vlan
- sw1(config-if)#switchport trunk ?
- allowed Set allowed VLAN characteristics when interface is in trunking
- mode
- encapsulation Set trunking encapsulation when interface is in trunking mode
- native Set trunking native characteristics when interface is in
- trunking mode
- sw1(config-if)#switchport trunk allowed vlan 1 , 10 , 20 ——允许特定vlan通过
宏观上,就是两个接口的配置需一模一样!!!!
————————————————————————————————————————————————————————
- int range f0/1 , f0/2
- channel-group 1 mode on
- exit
-
- int port-channel 1
- sw tr en dot
- sw mode tr
- exit
-
- SW1#show int port-channel 1
LACP:链路聚合控制协议,有active和 passive,仅支持全双工
PAGP: desirable和 auto,只要双方的双工模式相同即可。
其中,desirable和 active是主动协商,而passive和 auto都是被动响应的。手工(on)和主动/auto是不能协商的。
| LACP/PAGP协商 | on(手工指定) | active/desirable(主动收发 | passive/auto(只收不发) |
| on | ✔ | × | × |
| active/desirable | × | ✔ | ✔ |
| passive/auto | × | ✔ | × |
- channel-group id(编号,最多256组) mode(模式) on/auto/desirable/active/passive
- show etherchannel summary //查看ether channel状态。
- show etherchannel detail //查看ether channe1 详细描述
- no interface port-channel n //删除聚合后端口n

———————————————————————————————————————————————————————
(Cisco Packet Tracer)

desirable —— desirable 验证:
注:配置时,可以先把相关的接口关闭,防止抑制。
——————————————————————————————————————————————————————————
1、基于数据包的链路负载均衡(假设pc1有10个数据包,有5个从0/6接口转发,有5个从0/7接口转发)
2、基于会话的负载:
- Switch(config)#port-channel load-balance ?
- dst-ip Dst IP Addr ——目的IP做负载均衡
- dst-mac Dst Mac Addr
- src-dst-ip Src XOR Dst IP Addr
- src-dst-mac Src XOR Dst Mac Addr
- src-ip Src IP Addr
- src-mac Src Mac Addr
- Switch(config)#port-channel load-balance dst-ip
-
- Switch(config)#do show etherchannel load-balance ——查看
- EtherChannel Load-Balancing Operational State (src-mac):
- Non-IP: Source MAC address
- IPv4: Source MAC address
- IPv6: Source MAC address
-
- Switch(config)#
当pc1访问pc3时,流量要从sw1和sw3之间的链路通过,此时,涉及到负载均衡

————————————————————————————————————————————————————————
- int f0/0
- lacp port-priority ID
//设定LACP的端口优先级,优先级越小越好,越小越优先。默认32768 (1 — 65535)
。越小,就说明永远成为这个组中的成员,无论这个链路有多少个成员。(当一共捆绑了16个接口,而 实际生效的接口只有1~8,共八个,其他为备份接口。当他们之间的(假设为优先级为4的接口出现故障,那么优先级为9的接口会立即加入进来)
注意: ether channel不支持10M端口的 banding,而思科最多支持8个端口的聚合。
- int f0/0
- pagp port-priority ID
- pagp learn-method aggregation-port ——按聚合端口学习mac地址
- pagp learn-method physical-port ——按物理接口学习MAC (默认)
设定PAGP的端口优先级,越大越好,越大越优先.默认128 (0 — 255)
优先级越大,越优先捆绑,优先级一样根据port-id选举
- pagp learn-method aggregation-port ——按聚合端口学习mac地址
- pagp learn-method physical-port ——按物理接口学习MAC (默认)
————————————————————————————————————————————————————————
