1. 网络拓扑
2. 配置
R1配置
[R1-GigabitEthernet0/0/1]ip address 10.1.1.1 30
[R1-GigabitEthernet0/0/0]ip address 192.168.1.253 24
[R1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[R1-GigabitEthernet0/0/0]vrrp vrid 1 priority 120
[R1-GigabitEthernet0/0/0]vrrp vrid 1 track interface Gi0/0/1 reduced 30
#为R1添加静态默认路由,使得它能够将去往外部网络的流量转发到Net1:
[R1]ip route-static 0.0.0.0 0 10.1.1.2
R2配置
[R2-GigabitEthernet0/0/1]ip address 10.2.2.2 30
[R2-GigabitEthernet0/0/0]ip address 192.168.1.252 24
[R2-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
#为R2添加静态默认路由,使得它能够将去往外部网络的流量转发到Net1:
[R2]ip route-static 0.0.0.0 0 10.2.2.1
Net1配置
[Net1-GigabitEthernet0/0/1]ip address 10.1.1.2 30
[Net1-GigabitEthernet0/0/2]ip address 10.2.2.1 30
[Net1]interface LoopBack 0
[Net1-LoopBack0]ip address 1.1.1.1 32
#为Net1添加去往192.168.1.0/24网段的静态路由:
[Net1]ip route-static 192.168.1.0 24 10.1.1.1
[Net1]ip route-static 192.168.1.0 24 10.2.2.2
3. 查看配置
查看路由走向:
将R1的 0/0/1端口Down掉:
查看:
此时,查看路由走向:
打开R1的0/01端口:
此时,又恢复为Master: