CCNP-EIGRP发布默认路由的方法总结:
实验拓扑:
实验目标:
总结EIGRP发布默认路由的方法.
路由的简单配置(略)
IP地址和EIGRP配置:
r1(config)#in s1/0
r1(config-if)#ip add 219.146.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#in loo 0
r1(config-if)#ip add 1.1.1.1 255.255.255.0
r1(config-if)#in loo 1
r1(config-if)#ip add 11.11.11.11 255.255.255.0
r1(config-if)#exi
r1(config)#router e 10
r1(config-router)#no au
r1(config-router)#net 1.1.1.0 0.0.0.255
r1(config-router)#net 219.146.0.0 0.0.0.255
r1(config-router)#exi
r2(config)#in s1/0
r2(config-if)#ip add 219.146.0.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#in s1/1
r2(config-if)#ip add 219.146.1.1 255.255.255.0
r2(config-if)#no sh
r2(config-if)#router e 10
r2(config-router)#no au
r2(config-router)#net 219.146.0.0 0.0.0.255
r2(config-router)#net 219.146.1.0 0.0.0.255
r2(config-router)#exi
r3(config)#in s1/1
r3(config-if)#ip add 219.146.1.2 255.255.255.0
r3(config-if)#no sh
r3(config-if)#in loo 0
r3(config-if)#ip add 3.3.3.3 255.255.255.0
r3(config-if)#in loo 1
r3(config-if)#ip add 33.33.33.33 255.255.255.0
r3(config-if)#exi
r3(config)#router e 10
r3(config-router)#no au
r3(config-router)#net 219.146.1.0 0.0.0.255
r3(config-router)#net 3.3.3.0 0.0.0.255 //这里没有宣告33.33.33.33
r3(config-router)#exi
基本信息配置完成后查看一下R1路由表:
r1(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/2809856] via 219.146.0.2, 00:01:00, Serial1/0
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.1.0/24 [90/2681856] via 219.146.0.2, 00:03:05, Serial1/0
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
一切正常.接下来开始发布默认路由.(所有的发布都在R3上做)
(一) 路由重分布
r3(config)#ip route 0.0.0.0 0.0.0.0 loopback 1 //先添加一条静态默认路由,也可以跟下一跳地址
r3(config)#router e 10
r3(config-router)#redistribute static //重分布静态路由
r3(config-router)#exi
现在来查看一下R1的路由表:
r1(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 219.146.0.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/2809856] via 219.146.0.2, 00:09:11, Serial1/0
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.1.0/24 [90/2681856] via 219.146.0.2, 00:11:17, Serial1/0
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
D*EX 0.0.0.0/0 [170/2809856] via 219.146.0.2, 00:05:57, Serial1/0
发现多了一条D*EX的路由.注意这里的管理距离是170.这就说明静态路由发布成功了.现在在R1上ping一下33.33.33.33.因为33.33.33.33没有在路由表中.如果能通说明静态默认路由就起作用了.
r1(config)#do p 33.33.33.33
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.33, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/48/120 ms
没问题.这是第一种方法.
(二)使用network命令
首先把刚才的去掉.因为这里也需要静态默认路由.所以不去掉了.
注意:这里的静态默认路由只能跟出接口,不能是下一跳地址.
r3(config)#router e 10
r3(config-router)#no redistribute static
r3(config-router)#net 0.0.0.0
r3(config-router)#exi
就这么简单.再查看一下R1.
r1(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 219.146.0.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
33.0.0.0/24 is subnetted, 1 subnets
D 33.33.33.0 [90/2809856] via 219.146.0.2, 00:01:44, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/2809856] via 219.146.0.2, 00:21:08, Serial1/0
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.1.0/24 [90/2681856] via 219.146.0.2, 00:23:14, Serial1/0
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
D* 0.0.0.0/0 [90/2809856] via 219.146.0.2, 00:01:44, Serial1/0
也产生了一条D*静态默认路由.管理距离90.
注 意:这种方法R3会把所有路由都通告出来.一般不使用这种方法.
这里就不测试了.R1肯定能ping通33.33.33.33
(三)使用手工汇总
r3(config)#router e 10
r3(config-router)#no net 0.0.0.0
r3(config-router)#exi
r3(config)#no ip route 0.0.0.0 0.0.0.0 loo 1
r3(config)#in s1/1
r3(config-if)#ip summary-address eigrp 10 0.0.0.0 0.0.0.0
r3(config-if)#exi
r1(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 219.146.0.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.1.0/24 [90/2681856] via 219.146.0.2, 00:32:54, Serial1/0
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
D* 0.0.0.0/0 [90/2809856] via 219.146.0.2, 00:04:27, Serial1/0
这里也产生了静态默认路由,管理距离90.R3并没有通告所有路由信息.
(四)使用ip default-network
r3(config)#in s1/1
r3(config-if)#no ip summary-address eigrp 10 0.0.0.0 0.0.0.0
r3(config-if)#exi
这种方法的必要条件是:ip default-network后跟主类网络,要开启自动汇总,还要把这条路由宣告出去.
r3(config)#ip default-network 33.0.0.0 //跟主类网络
r3(config)#router e 10
r3(config-router)#au //开启自动汇总
r3(config-router)#net 33.0.0.0 0.255.255.255 //宣告
r3(config-router)#exi
r1(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 219.146.0.2 to network 33.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
D* 33.0.0.0/8 [90/2809856] via 219.146.0.2, 00:00:23, Serial1/0
D 3.0.0.0/8 [90/2809856] via 219.146.0.2, 00:01:42, Serial1/0
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.1.0/24 [90/2681856] via 219.146.0.2, 00:39:09, Serial1/0
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
注意这条静态默认路由,这里显示的并不是0.0.0.0/0了.
(五)在第四种的基础上加上一句
r3(config)#ip route 33.0.0.0 255.0.0.0 loo 1
但这样只是在本地查看时有点不一样,我不知道还有什么不一样的.请知道的告诉我,谢谢!
不加这条在本地查看是:
r3(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 0.0.0.0 to network 33.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
D 1.1.1.0 [90/2809856] via 219.146.1.1, 00:42:57, Serial1/1
* 33.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 33.33.33.0/24 is directly connected, Loopback1
D* 33.0.0.0/8 is a summary, 00:05:43, Null0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Loopback0
D 3.0.0.0/8 is a summary, 00:07:02, Null0
D 219.146.0.0/24 [90/2681856] via 219.146.1.1, 00:42:57, Serial1/1
C 219.146.1.0/24 is directly connected, Serial1/1
加上这条在本地查看是:
r3(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
D 1.1.1.0 [90/2809856] via 219.146.1.1, 00:44:16, Serial1/1
* 33.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 33.33.33.0/24 is directly connected, Loopback1
S* 33.0.0.0/8 is directly connected, Loopback1
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, Loopback0
D 3.0.0.0/8 is a summary, 00:08:21, Null0
D 219.146.0.0/24 [90/2681856] via 219.146.1.1, 00:44:16, Serial1/1
C 219.146.1.0/24 is directly connected, Serial1/1
(六)也是在第四种的基础上做更改.关闭自动汇总,然后使用手工汇总.
r3(config)#no ip route 33.0.0.0 255.0.0.0 loo 1
r3(config)#router e 10
r3(config-router)#no au
r3(config-router)#exi
r3(config)#in s1/1
r3(config-if)#ip summary-address eigrp 10 33.0.0.0 255.0.0.0
r3(config-if)#exi
r1(config)#do sh ip rou
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 219.146.0.2 to network 33.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
D* 33.0.0.0/8 [90 /2809856] via 219.146.0.2, 00:00:48, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
D 3.3.3.0 [90/2809856] via 219.146.0.2, 00:02:44, Serial1/0
C 219.146.0.0/24 is directly connected, Serial1/0
D 219.146.1.0/24 [90/2681856] via 219.146.0.2, 00:53:45, Serial1/0
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
这里也不是0.0.0.0/0.这样关闭了自动汇总,比第四种要好点.
我知道的也就这种方法了,如果还有别的方法,希望和我交流,共同学习!
我现在是自习NP中,如有不准确的请大家指正.多多谅解!