拓撲圖
實驗過程
1. pc的配置
Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line con 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host pc pc(config)#no ip routing pc(config)#int f0/0 pc(config-if)#no shut pc(config-if)#ip add 192.168.1.1 255.255.255.0 pc(config-if)#exit pc(config)#ip default-gateway 192.168.1.254 pc(config)#end |
2. R1的配置
Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line con 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R1 R1(config)#int f0/0 R1(config-if)#no shut R1(config-if)#ip add 192.168.1.10 255.255.255.0 R1(config-if)#vrrp 10 ip 192.168.1.254 //配置vrrp組10的IP R1(config-if)#end |
3. R2的配置
Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#no ip domain-lookup Router(config)#line con 0 Router(config-line)#no exec-timeout Router(config-line)#loggin syn Router(config-line)#exit Router(config)#host R2 R2(config)#int f0/0 R2(config-if)#no shut R2(config-if)#ip add 192.168.1.20 255.255.255.0 R2(config-if)#vrrp 10 ip 192.168.1.254 R2(config-if)#end |
4. 查看vrrp信息
R1#show vrrp bri Interface Grp Pri Time Own Pre State Master addr Group addr Fa0/0 10 100 3609 Y Backup 192.168.1.20 192.168.1.254 R2#show vrrp bri Interface Grp Pri Time Own Pre State Master addr Group addr Fa0/0 10 100 3609 Y Master 192.168.1.20 192.168.1.254 |
說明:現在R1是Backup Router,R2是Master Router,R2處於轉發狀態。
5. 關閉R2的f0/0,模擬故障。
R2(config)#int f0/0 R2(config-if)#shut R1#show vrrp br Interface Grp Pri Time Own Pre State Master addr Group addr Fa0/0 10 100 3609 Y Master 192.168.1.10 192.168.1.254 |
說明:現在R1是Master Router,處於轉發狀態
6. 測試連通性
pc#ping 192.168.1.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.254, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 12/40/64 ms pc#traceroute 192.168.1.254 Type escape sequence to abort. Tracing the route to 192.168.1.254 1 192.168.1.10 56 msec * 36 msec //pc現在走R1 |