三层链路聚合实验——聚合端口为三层口
-
配置PC
配置IP地址、子网掩码、网关
-
配置左侧三层交换机
Switch> en Switch# configure terminal Switch(config)# vlan 10 Switch(config-vlan)# ex Switch(config)# ip routing Switch(config)# interface F0/1 Switch(config-if)# switchport mode accrss Switch(config-if)# switchport access vlan 10 Switch(config-if)# ex Switch(config)# interface range F0/2-3 //以下开始为配置聚合端口的核心命令,这句是批量配置F0/2口到F0/3口 Switch(config-if-range)# no switchport Switch(config-if-range)# channel-protocol lacp //封装协议为lacp,可以是pagp都可以 Switch(config-if-range)# channel-group 1 mode active //把一起配置的这几个端口划分到 1 这个聚合组中,状态为active, //如果上一条封装的是 pagp 那么把 active 改为 desirable Switch(config-if-range)# no shutdown Switch(config-if-range)# ex Switch(config)# interface port-channel 1 Switch(config-if)# no switchport Switch(config-if)# ip address 12.0.0.1 255.255.255.0 Switch(config-if)# no shutdown
-
配置右侧三层交换机
Switch> en Switch# configure terminal Switch(config)# vlan 20 Switch(config-vlan)# ex Switch(config)# ip routing Switch(config)# interface F0/1 Switch(config-if)# switchport mode accrss Switch(config-if)# switchport access vlan 20 Switch(config-if)# ex Switch(config)# interface range F0/2-3 Switch(config-if-range)# no switchport Switch(config-if-range)# channel-protocol lacp Switch(config-if-range)# channel-group 1 mode active Switch(config-if-range)# no shutdown Switch(config-if-range)# ex Switch(config)# interface port-channel 1 Switch(config-if)# no switchport Switch(config-if)# ip address 12.0.0.2 255.255.255.0 Switch(config-if)# no shutdown
-
配置路由
//可以给两台三层交换机分别一条默认路由指向对方 //左侧三层交换机 Switch(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.2 //右侧三层交换机 Switch(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.1
-
实验验证
PC0 ping PC1 通证明实验成功
二层链路聚合实验——聚合端口为二层口
-
配置PC
配置IP地址、子网掩码
-
配置SW0
Switch> en Switch# configure terminal Switch(config)# interface range F0/1-2 Switch(config-if-range)# switchport trunk encapsulation dot1q //若为三层交换机trunk口聚合的话要先进行封装 Switch(config-if-range)# switchport mode trunk Switch(config-if-range)# channel-protocol lacp Switch(config-if-range)# channel-group 1 mode active Switch(config-if-range)# no shutdown Switch(config-if-range)# ex Switch(config)# interface port-channel 1 Switch(config-if-range)# switchport trunk encapsulation dot1q Switch(config-if-range)# switchport mode trunk Switch(config-if)# no shutdown
-
配置SW1
Switch> en Switch# configure terminal Switch(config)# interface range F0/1-2 Switch(config-if-range)# switchport trunk encapsulation dot1q //若为三层交换机trunk口聚合的话要先进行封装 Switch(config-if-range)# switchport mode trunk Switch(config-if-range)# channel-protocol lacp Switch(config-if-range)# channel-group 1 mode active Switch(config-if-range)# no shutdown Switch(config-if-range)# ex Switch(config)# interface port-channel 1 Switch(config-if-range)# switchport trunk encapsulation dot1q Switch(config-if-range)# switchport mode trunk Switch(config-if)# no shutdown
-
实验验证
PC0 ping PC1 通证明实验成功