您好,登錄后才能下訂單哦!
----PC的配置-------
PC#configure terminal
PC(config)#no ip routing
PC(config)#ip default-gateway 192.168.1.100
PC(config)#interface e0/0
PC(config-if)#ip address 192.168.1.200 255.255.255.0
PC(config-if)#no shutdown
PC(config-if)#end
----R1的配置-------
R1#configure terminal
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#standby 1 ip 192.168.1.100
R1(config-if)#standby 1 priority 120
R1(config-if)#standby 1 preempt
R1(config-if)#standby 1 track s1/0 30
R1(config-if)#exit
R1(config-if)#interface s1/0
R1(config-if)#ip address 13.13.13.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
----R2的配置-------
R2#configure terminal
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#standby 1 ip 192.168.1.100
R2(config-if)#standby 1 priority 100
R2(config-if)#standby 1 preempt
R2(config-if)#interface s1/1
R2(config-if)#ip address 23.23.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
----R3的配置-------
R3#configure terminal
R3(config)#interface s1/0
R3(config-if)#ip address 13.13.13.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#interface s1/1
R3(config-if)#ip address 23.23.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config-if)#interface loopback 0
R3(config-if)#ip address 202.101.18.8 255.255.255.0
R3(config-if)#end
快捷配置方式
----PC的配置-------
configure terminal
no ip routing
ip default-gateway 192.168.1.100
interface e0/0
ip address 192.168.1.200 255.255.255.0
no shutdown
end
----R1的配置-------
configure terminal
interface f0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
standby 1 ip 192.168.1.100
standby 1 priority 120
standby 1 preempt
standby 1 track s1/0 30
interface s1/0
ip address 13.13.13.1 255.255.255.0
no shutdown
end
----R2的配置-------
configure terminal
interface f0/0
ip address 192.168.1.2 255.255.255.0
no shutdown
standby 1 ip 192.168.1.100
standby 1 priority 100
standby 1 preempt
interface s1/0
ip address 23.23.23.2 255.255.255.0
no shutdown
end
----R3的配置-------
configure terminal
interface s1/0
ip address 13.13.13.3 255.255.255.0
no shutdown
interface s1/1
ip address 23.23.23.3 255.255.255.0
no shutdown
interface loopback 0
ip address 202.101.18.8 255.255.255.0
end
說明:如果想查看配置的結果,可以在R1上輸入命令
R1#show standby
可以看到如下信息
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is 192.168.1.2 expires in 7.900
說明192.168.1.2是Standby狀態
如果禁用R1的s1/0口
R1#configure terminal
R1(config)#interface s1/0
R1(config-if)#shutdown
R1#show standby
可以看到如下信息:
Virtual IP address is 192.168.1.100 configured
Active router is 192.168.1.2, priority 100 expires in 7.940
Standby router is local
說明192.168.1.2是Active狀態
當然如果你想在PC上traceroute 202.101.18.8,則必須配置路由協議。
如果你不想讓R1和R2通過RIP路由協議發現對方,則可以這樣配置
R1(config)#router rip
R1(config-router)#network 13.13.13.0
R1(config-router)#network 192.168.1.0
R1(config-router)#passive-interface f0/0
R2(config)#router rip
R1(config-router)#network 23.23.23.0
R1(config-router)#network 192.168.1.0
R2(config-router)#passive-interface f0/0
現在,可以在PC上試一下traceroute命令
PC#traceroute 202.101.18.8
Type escape sequence to abort.
Tracing the route to 202.101.18.8
1 192.168.1.1 52 msec 68 msec 20 msec
2 13.13.13.3 28 msec * 12 msec
PC#
關閉R1的s1/0口,再試
PC#traceroute 202.101.18.8
Type escape sequence to abort.
Tracing the route to 202.101.18.8
1 192.168.1.2 68 msec 109 msec 32 msec
2 23.23.23.3 64 msec * 0 msec
PC#
從兩次輸出看出結果的正確性。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。