EIGRP注入默認路由

一、實驗目的
掌握通過ip default-network命令配置EIGRP默認網絡。
二、實驗拓撲


 
三、實驗要求:
R1,R2,R3運行EIGRP,用ip default-network 命令使EIGRP向EIGRP域內傳遞缺省路由,各路由器的各環回口之間路由可達。
四:實驗過程:
1、 基本接口的配置.(見圖)
1(config)#int e0/0
R1(config-if)#ip add 12.0.0.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#^Z

R2(config)#int e0/0
R2(config-if)#ip add 12.0.0.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int e0/1
R2(config-if)#ip add 23.0.0.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0

R3(config)#int e0/1
R3(config-if)#ip add 23.0.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int s1/0
R3(config-if)#ip add 34.0.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0

R4(config)#int s0/1
R4(config-if)#ip add 34.0.0.4 255.255.255.0
R4(config-if)#no sh
R4(config)#int lo 0
R4(config-if)#ip add 4.4.4.4 255.255.255.0


2、EIGRP的配置:
R1(config)#router eigrp 1
R1(config-router)#net 12.0.0.0 0.0.0.255
R1(config-router)#net 1.1.1.0 0.0.0.255
R1(config-router)#no au

R2(config)#router eigrp 1
R2(config-router)#net 12.0.0.0 0.0.0.255
R2(config-router)#net 23.0.0.0 0.0.0.255
R2(config-router)#net 2.2.2.0 0.0.0.255
R2(config-router)#no au

R3(config)#router eigrp 1
R3(config-router)#net 23.0.0.0 0.0.0.255
R3(config-router)#net 3.3.3.0 0.0.0.255
R3(config-router)#no au
在各臺路由器上查看路由表,並相互ping,發現內部網絡已經可以全部通信。
3:IP Default-network的配置:
R3做內部網絡的出口路由器,R4做外部路由器,分別配置往返內外網的靜態路由。
R3(config)#ip route 0.0.0.0 0.0.0.0 34.0.0.4

R4(config)#ip route 1.1.1.0 255.255.255.0 34.0.0.3
R4(config)#ip route 2.2.2.0 255.255.255.0 34.0.0.3
R4(config)#ip route 3.3.3.0 255.255.255.0 34.0.0.3
R3#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
R2#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
....
R1#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
....
//發現R3可以互通,R1,R2不可以通。原因,R3上有默認路由而R1,R2無。要使用內部路由器能投也有到達外部的路由
解決方法:
使用ip default-network:通過配置缺省網絡,通過動態路由協議(EIGRP)向相關路由器傳遞缺省路由。
R3(config)#ip default-network 34.0.0.0

R3#sho ip route

Gateway of last resort is 34.0.0.4 to network 0.0.0.0

 *   34.0.0.0/24 is subnetted, 1 subnets
C*      34.0.0.0 is directly connected, Serial1/0    //直連網絡34.0.0.0/24承載了缺省路由。
     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/435200] via 23.0.0.2, 00:15:33, Ethernet0/1
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/409600] via 23.0.0.2, 00:15:33, Ethernet0/1
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, Ethernet0/1
     12.0.0.0/24 is subnetted, 1 subnets
D       12.0.0.0 [90/307200] via 23.0.0.2, 00:15:33, Ethernet0/1
S*   0.0.0.0/0 [1/0] via 34.0.0.4
查看R1,R2的路由表:
R2#ping 4.4.4.4 source 2.2.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
R1#ping 4.4.4.4 source 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
//發現R1,R2也可以和外部網絡相互通信了,原因是它已經學習到了R3通過eigrp向域內發佈的缺省路由。
R1#sho ip route eigrp
     34.0.0.0/24 is subnetted, 1 subnets
D*      34.0.0.0 [90/2221056] via 12.0.0.2, 00:10:50, Ethernet0/0
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/409600] via 12.0.0.2, 00:11:05, Ethernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
D       3.3.3.0 [90/435200] via 12.0.0.2, 00:11:05, Ethernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
D       23.0.0.0 [90/307200] via 12.0.0.2, 00:11:05, Ethernet0/0
R2#sho ip route eigrp
     34.0.0.0/24 is subnetted, 1 subnets
D*      34.0.0.0 [90/2195456] via 23.0.0.3, 00:11:03, Ethernet0/1
     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/409600] via 12.0.0.1, 00:11:13, Ethernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
D       3.3.3.0 [90/409600] via 23.0.0.3, 00:11:13, Ethernet0/1

==============================================

其它方法:
• 法2:
Ip route 0.0.0.0 0.0.0.0 null 0  本地寫缺省路由
Router eigrp 1
Redistribure static
• 法3:
Ip route 0.0.0.0 0.0.0.0 null 0
Router eigrp 1
Net 0.0.0.0
• 法4:彙總:
接口模式下:ip summary-address eigrp 1 0.0.0.0 0.0.0.0

此處不再實驗了,有興趣的讀者可以自己再做一下^-^
五:實驗總結:

使用ip default-network命令可以有效減少內部網絡配置任務。不過需要注意的是ip default-network其指出默認網絡,建議採用主類網絡。如果使用無類網絡,則可能會出現無法解釋的問題。
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章