您好,登錄后才能下訂單哦!
----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
說(shuō)明:如果想查看配置的結(jié)果,可以在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
說(shuō)明192.168.1.2是Standby狀態(tài)
如果禁用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
說(shuō)明192.168.1.2是Active狀態(tài)
當(dāng)然如果你想在PC上traceroute 202.101.18.8,則必須配置路由協(xié)議。
如果你不想讓R1和R2通過(guò)RIP路由協(xié)議發(fā)現(xiàn)對(duì)方,則可以這樣配置
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
現(xiàn)在,可以在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#
關(guān)閉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#
從兩次輸出看出結(jié)果的正確性。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。