M-LAG+VRRP+双活网关配置实验

1,354 阅读2分钟

网络拓扑

图片.png

  1. S1 S2 组成m-lag组 下行vrrp网关 vrrp地址为192.168.10.254 上行双活网关 ip地址192.168.1.2 mac地址0001-0001-0001
  2. m-lag组 g1/0/3为keepalive g1/0/1-g1/0/2为peerlink
  3. 上下行设备与m-lag组均采用动态链路聚合形式

配置命令

S1配置

# m-lag组系统配置
m-lag mad exclude interface GigabitEthernet1/0/3        // mad排除g1/0/3
m-lag role priority 120                                 // 配置m-lag设备优先级
m-lag system-mac 8a85-1771-0100                         // 配置m-lag设备mac 用于stp_root
m-lag system-number 1                                   // m-lag组设备编号
m-lag system-priority 4096                              // 系统stp优先级
m-lag consistency-check disable                         // 模拟器需要关闭配置一致性检查
m-lag keepalive ip destination 1.1.1.2 source 1.1.1.1   // keepalive

# 创建vlan10
vlan 10

# peerlink链路聚合
interface Bridge-Aggregation1
 description peerlink
 port link-type trunk
 port trunk permit vlan all
 link-aggregation mode dynamic
 port m-lag peer-link 1

# 下行链路聚合
interface Bridge-Aggregation2
 port access vlan 10
 link-aggregation mode dynamic
 port m-lag group 2

# 上行链路聚合
interface Bridge-Aggregation3
 link-aggregation mode dynamic
 port m-lag group 3

# 三层路由接口keepalive
interface GigabitEthernet1/0/3
 port link-mode route                     // 配置为三层接口
 combo enable fiber
 ip address 1.1.1.1 255.255.255.252

# 上联互联接口
interface Vlan-interface1
 ip address 192.168.1.2 255.255.255.0
 mac-address 0001-0001-0001                // 双活网关配置mac地址

# 下联互联接口
interface Vlan-interface10
 ip address 192.168.10.252 255.255.255.0    // 配置接口地址
 vrrp vrid 10 virtual-ip 192.168.10.254     // 配置vrrp 10 网关地址
 vrrp vrid 10 priority 120                 // 配置vrrp优先级
 vrrp vrid 10 track 1 priority reduced 50   // 配置多主检测

# mstp配置
stp region-configuration
 instance 10 vlan 10 
 active region-configuration

# 缺省路由
ip route-static 0.0.0.0 0 192.168.1.1

S2配置

#
m-lag mad exclude interface GigabitEthernet1/0/3
m-lag system-mac 8a85-1771-0100
m-lag system-number 2
m-lag system-priority 4096
m-lag consistency-check disable
m-lag keepalive ip destination 1.1.1.1 source 1.1.1.2
#
vlan 10
#
interface Bridge-Aggregation1
 description peerlink
 port link-type trunk
 port trunk permit vlan all
 link-aggregation mode dynamic
 port m-lag peer-link 1
#
interface Bridge-Aggregation2
 port access vlan 10
 link-aggregation mode dynamic
 port m-lag group 2
#
interface Bridge-Aggregation3
 link-aggregation mode dynamic
 port m-lag group 3
#
interface GigabitEthernet1/0/3
 port link-mode route
 combo enable fiber
 ip address 1.1.1.2 255.255.255.252
#
interface Vlan-interface1
 ip address 192.168.1.2 255.255.255.0
 mac-address 0001-0001-0001
#
interface Vlan-interface10
 ip address 192.168.10.253 255.255.255.0
 vrrp vrid 10 virtual-ip 192.168.10.254
 vrrp vrid 10 track 1 priority reduced 50
#
stp region-configuration
 instance 10 vlan 10 
 active region-configuration
#
ip route-static 0.0.0.0 0 192.168.1.1

配置验证

图片.png

图片.png

图片.png

图片.png