1 、问题
1)配置接口IP地址
2)配置 VRRP 主备网关
3)配置 VRRP 链路跟踪
4)断开 R1 G0/0/1 查看 VRRP 状态
2、搭建实验环境,如图所示
3、步骤
实现此案例需要按照如下步骤进行。
1)配置终端设备 PC1
PC-1 IP 地址:
192.168.1.1
255.255.255.0
192.168.1.254 // 后期通过 VRRP 形成的 虚拟网关IP
PC-2 IP 地址:
192.168.2.1
255.255.255.0
192.168.2.254 // R3的网关接口IP地址
2)配置交换机,vlan,接口加入vlan
[SW1]vlan 10
[SW1-vlan10]quit
[SW1]port-group group-member g0/0/1 to g0/0/3
[SW1-port-group]port link-type access
[SW1-port-group]port default vlan 10
3)R1/R2配置接口IP地址,配置VRRP,R1为主路由器,R2为备份路由器
R1配置:
[R1]int g0/0/0
[R1-G0/0/0]ip address 192.168.1.251 24
[R1-G0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[R1-G0/0/0]vrrp vrid 1 priority 130
[R1-G0/0/0]int g0/0/1
[R1-G0/0/1]ip address 192.168.13.1 24
R2配置:
[R2]int g0/0/0
[R2-G0/0/0]ip address 192.168.1.252 24
[R2-G0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[R2-G0/0/0]int g0/0/2
[R2-G0/0/2]ip address 192.168.23.1 24
4)R1/R2/R3配置静态路由
R1配置:
[R1]ip route-static 192.168.2.0 24 192.168.13.3
R2配置:
[R2]ip route-static 192.168.2.0 24 192.168.23.3
R3配置:
[R3]int g0/0/1
[R3-G0/0/1]ip address 192.168.13.3 24
[R3-G0/0/1]int g0/0/2
[R3-G0/0/2]ip address 192.168.23.3 24
[R3-G0/0/2]int g0/0/0
[R3-G0/0/0]ip address 192.168.2.254 24
[R3-Gt0/0/0]quit
[R3]ip route-static 192.168.1.0 24 192.168.13.1
[R3]ip route-static 192.168.1.0 24 192.168.23.1
5)验证VRRP
<R1>display vrrp //查看详细信息
<R1>display vrrp brief //查看简要信息
<R2>display vrrp //查看详细信息
<R2>display vrrp brief //查看简要信息
PC1 -->ping 192.168.2.1
PC1 -->tracert 192.168.2.1 //验证数据报文是否经主路由器转发
7)模拟R1上行链路故障,验证结果
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]shutdown //模拟R1的g0/0/1口链路故障
<R1>display vrrp //查看R1的状态,上行链路down掉后,R1是否还是Master设备
<R2>display vrrp //查看R2的状态
PC1 -->ping 192.168.2.1 //验证是否出现故障,是否能够正常通信
8)配置 R1 的 VRRP 链路跟踪
[R1-G0/0/0]vrrp vrid 1 track interface GigabitEthernet 0/0/1 reduced 50
9)把R1的上行链路接口g0/0/1 shutdown 掉,验证R2是否会升级为 master
<R1>display vrrp //查看R1的状态
<R2>display vrrp //查看R2的状态,R1上行接口(链路)down掉后,R2是否升级为新的Master
PC1 -->ping 192.168.2.1
PC1 -->tracert 192.168.2.1 //验证数据报文转发路径
标签:ENSP,R1,R2,G0,ip,R3,192.168,VRRP,链路
From: https://blog.csdn.net/weixin_45181514/article/details/139678069