溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Cisco ios ip default-network 補(bǔ)充說(shuō)明

發(fā)布時(shí)間:2020-07-23 00:49:49 來(lái)源:網(wǎng)絡(luò) 閱讀:274 作者:Cisco1841sw 欄目:移動(dòng)開發(fā)
1.標(biāo)記一個(gè)路由條目 為缺省網(wǎng)絡(luò)                   2.在RIP,EIGRP/IGRP中提供缺省網(wǎng)絡(luò)的傳播
【補(bǔ)充說(shuō)明】
1.使用ip default-network標(biāo)記靜態(tài)路由指定的路由為缺省網(wǎng)絡(luò),在RIP中不會(huì)傳播出去;在IGRP、EIGRP中不存在這 個(gè)問(wèn)題,因?yàn)樗鼈儽緛?lái)就需要將這個(gè)網(wǎng)段通告到路由協(xié)議中才能傳播出去
2.使用ip default-network標(biāo)記直連網(wǎng)絡(luò)為缺省不會(huì)被使用,因?yàn)闆](méi)有下一跳。
【案例說(shuō)明】
【實(shí)驗(yàn)一】
Cisco ios ip default-network 補(bǔ)充說(shuō)明
R1:
interface Serial1/0
ip address 192.168.12.1 255.255.255.0
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
router rip
network 192.168.12.0
R2:
interface Serial1/0
ip address 192.168.23.2 255.255.255.0
!
interface Serial2/0
ip address 192.168.12.2 255.255.255.0
router rip
network 192.168.12.0
ip default-network 3.0.0.0
ip route 3.0.0.0 255.0.0.0 192.168.23.3
R3:
interface Loopback3
ip address 6.6.6.6 255.255.255.0 secondary
ip address 3.3.3.3 255.255.255.0
!
interface Serial2/0
ip address 192.168.23.3 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.23.2
查看結(jié)果
R2#sh ip rou
Gateway of last resort is 192.168.23.3 to network 3.0.0.0
C 192.168.12.0/24 is directly connected, Serial2/0
S*    3.0.0.0/8 [1/0] via 192.168.23.3
C 192.168.23.0/24 is directly connected, Serial1/0

R1#sh ip rou
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, Serial1/0
可以看到R1并沒(méi)有獲得這個(gè)路由條目。下面更改一下R2的配置:
R2:
no ip default-network 3.0.0.0
no ip route 3.0.0.0 255.0.0.0 192.168.23.3
ip default-network 192.168.23.0
R2#sh ip rou
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, Serial2/0
C* 192.168.23.0/24 is directly connected, Serial1/0
R2#
*Oct   3 07:15:26.147: RIP: sending v1 update to 255.255.255.255 via Serial2/0 (192.168.12.2)
*Oct   3 07:15:26.147: RIP: build update entries
*Oct   3 07:15:26.147: subnet 0.0.0.0 metric 1
R1#sh ip rou
Gateway of last resort is 192.168.12.2 to network 0.0.0.0
C 192.168.12.0/24 is directly connected, Serial1/0
R*    0.0.0.0/0 [120/1] via 192.168.12.2, 00:00:20, Serial1/0
此時(shí)可以看到192.168.23.0也沒(méi)有在RIP中通告,但是由于使用了ip default-network使其變?yōu)榱四J(rèn)網(wǎng)絡(luò),從而將該網(wǎng)段通告了出去。
但是此時(shí)在R1上ping 6.6.6.6會(huì)ping 不通,因就在于R2上現(xiàn)在的缺省網(wǎng)絡(luò)無(wú)下一跳,Gateway of last resort is not set,
R1#ping 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
U
*Oct   3 07:21:46.751: IP: tableid=0, s=192.168.12.1 (local), d=6.6.6.6 (Serial1/0), routed via RIB
*Oct   3 07:21:46.751: IP: s=192.168.12.1 (local), d=6.6.6.6 (Serial1/0), len 100, sending
*Oct   3 07:21:46.779: IP: tableid=0, s=192.168.12.2 (Serial1/0), d=192.168.12.1 (Serial1/0), routed via RIB
R2(config)#
*Oct   3 07:21:46.711: IP: s=192.168.12.1 (Serial2/0), d=6.6.6.6, len 100, unroutable
*Oct   3 07:21:46.711: IP: tableid=0, s=192.168.12.2 (local), d=192.168.12.1 (Serial2/0), routed via RIB
解決方案:在R2上添加靜態(tài)缺省
R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.23.3
R1#ping 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
!!!!!
搞定!
[實(shí)驗(yàn)二]ip default-network在EIGRP中應(yīng)用案例
Cisco ios ip default-network 補(bǔ)充說(shuō)明
R1:
R1(config)#router eigrp 100
R1(config-router)#net 192.168.12.0
R2:
R2(config)#no router rip
R2(config)#router eigrp 100
R2(config-router)#net 192.168.12.0
R2(config-router)#net 192.168.23.0
R2(config-router)#pa s1/0

實(shí)驗(yàn)結(jié)果
R2#sh ip rou
Gateway of last resort is 192.168.23.3 to network 0.0.0.0
C 192.168.12.0/24 is directly connected, Serial2/0
C* 192.168.23.0/24 is directly connected, Serial1/0
S* 0.0.0.0/0 [1/0] via 192.168.23.3
R1#sh ip rou
Gateway of last resort is 192.168.12.2 to network 192.168.23.0
C 192.168.12.0/24 is directly connected, Serial1/0
D* 192.168.23.0/24 [90/2681856] via 192.168.12.2, 00:00:21, Serial1/0
R1#ping 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/41/48 ms
可以看到配置中和RIP不同的情況,需要將所通告的默認(rèn)路由網(wǎng)段通告到 EIGRP/IGRP中;而且通告出去不像RIP變?yōu)榱? .0.0.0/0,仍舊是缺省網(wǎng)絡(luò)。
向AI問(wèn)一下細(xì)節(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)容。

AI