eigrp默认路由
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1,R2,R3,分别指一条默认路由到12.1.1.1与13.1.1.1,
2,R1上指一条默认路由到14.1.1.4,
3,R1配置NAT,R2,R3便可访问4.4.4.4
4,但是如果内网不只R2,R3,有更多的设备,逐个的去配置默认路由工作比较大,因此我们这里实现R1自动向EIGRP 的网络内注入默认路由
基本配置
r2(config)#no ip do lo
r2(config)#line console 0
r2(config-line)#no exec-t
r2(config-line)#logg sy
r2(config-line)#inter e2/0
r2(config-if)#ip add 12.1.1.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#inter
*Mar 1 00:06:19.743: %LINK-3-UPDOWN: Interface Ethernet2/0, changed state to up
*Mar 1 00:06:20.743: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet2/0, changed state to up
Router(config)#host r3
r3(config)#no ip do lo
r3(config)#line console 0
r3(config-line)#no exec-t
r3(config-line)#logg sy
r3(config-line)#inter e2/0
r3(config-if)#ip add 13.1.1.3 255.255.255.0
r3(config-if)#no sh
r3(config-if)#
*Mar 1 00:08:06.847: %LINK-3-UPDOWN: Interface Ethernet2/0, changed state to up *Mar 1 00:08:07.847: %LINEPROTO-5-UPDOWN: Line protocol on Interface
Ethernet2/0, changed state to up
r3(config-if)#
Router(config)#host r1
r1(config)#no ip do lo
r1(config)#line con 0
r1(config-line)#no exec-timeout
r1(config-line)#logg synchronous
r1(config)#inter e1/0
r1(config-if)#ip add 12.1.1.1 255.255.255.0
r1(config-if)#no sh
*Mar 1 00:05:41.723: %LINK-3-UPDOWN: Interface Ethernet1/0, changed state to up
*Mar 1 00:05:42.723: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to up
r1(config-if)#inter e1/1
r1(config-if)#ip add 13.1.1.1 255.255.255.0
r1(config-if)#no sh
*Mar 1 00:05:54.119: %LINK-3-UPDOWN: Interface Ethernet1/1, changed state to up
*Mar 1 00:05:55.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/1, changed state to up
r1(config-if)#end
r1#ping
*Mar 1 00:08:04.983: %SYS-5-CONFIG_I: Configured from console by console
r1#ping 12.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 44/56/72 ms
r1#ping 13.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 13.1.1.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 40/62/84 ms
r1#
r1(config)#router ei 90
r1(config-router)#no au
r1(config-router)#net 12.1.1.0 0.0.0.255
r1(config-router)#net 13.1.1.0 0.0.0.255
r2(config)#router ei 90
r2(config-router)#net 12.1.1.0 0.0.0.255
r2(config-router)#no au
*Mar 1 00:11:54.491: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 90: Neighbor 12.1.1.1 (Ethernet2/0) is up: new adjacency
r3(config)#router ei 90
r3(config-router)#no au
r3(config-router)#net 13.1.1.0 0.0.0.255
r3(config-router)#
*Mar 1 00:12:28.759: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 90: Neighbor 13.1.1.1 (Ethernet2/0) is up: new adjacency
r3(config-router)#
r1(config)#inter s0/0
r1(config-if)#clock ra 64000
r1(config-if)#ip add 14.1.1.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#end
Router(config)#host r4
r4(config)#no ip do lo
r4(config)#line console 0
r4(config-line)#no exec-t
r4(config-line)#logg sy
r4(config-line)#
r4(config-line)#inter s0/0
r4(config-if)#ip add 14.1.1.4 255.255.255.0
r4(config-if)#no sh
*Mar 1 00:13:53.499: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r4(config-if)#do ping 14.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 34.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/73/108 ms
r4(config-if)#
r1(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.4 到外部网络的默认路由
r1(config)#access-list 111 permit ip any any 写一个NAT做地址转换
r1(config)#ip nat inside source list 111 interface s0/0 overload
r1(config)#inter s0/0
r1(config-if)#ip nat outside
r1(config-if)#inter e1/0
r1(config-if)#ip nat inside
r1(config-if)#inter e1/1
r1(config-if)#ip nat inside
在R3上配置一条默认路由,便可以与4.4.4.4通信
r3(config)#ip route 0.0.0.0 0.0.0.0 13.1.1.1
r3(config)#end
r3#ping
*Mar 1 00:31:04.067: %SYS-5-CONFIG_I: Configured from console by console
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:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 64/120/188 ms
在R2上配置一条默认路由,便可以与4.4.4.4通信
r2(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.1
r2(config)#end
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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 92/140/188 ms
r2#
但是有时内部网络设备多,不能逐个去配置,这时eigrp 的默认路由就尤其重要了,在这里删了R2 ,R3默认路由,删完就不能与4.4.4.4能通信
r2(config)#no ip route 0.0.0.0 0.0.0.0 12.1.1.1
r2(config)#do 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:
.....
Success rate is 0 percent (0/5)
r3(config)#no ip route 0.0.0.0 0.0.0.0 13.1.1.1
r3(config)#do 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: .....
Success rate is 0 percent (0/5
查看它们的路由表
r2#show ip route
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
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
D 13.1.1.0 [90/307200] via 12.1.1.1, 00:24:25, Ethernet2/0
r3#show ip route
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
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/307200] via 13.1.1.1, 00:23:37, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, Ethernet2/0
方法一
首先R1 要有一条前往14.1.1.0 的主类路由,下面查看R1的路由表,这个条路由中没有,因此要手工加
用network命令通告到EIGRP
然后ip default-network 将这条主路由配置为默认路由
r1#show ip route
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
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Ethernet1/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, Ethernet1/1
14.0.0.0/24 is subnetted, 1 subnets
C 14.1.1.0 is directly connected, Serial0/0
r1(config)#ip route 14.0.0.0 255.0.0.0 null 0 添加主类路由
r1(config)#router ei 90
r1(config-router)#net 14.0.0.0 在EIGRP中通告主类路由
r1(config-router)#exit
r1(config)#ip default-network 14.0.0.0 用ip default-network配置14.0.0.0为默认路由
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:
!!!!!
r3#show ip route
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 13.1.1.1 to network 14.0.0.0
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/307200] via 13.1.1.1, 01:14:49, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, Ethernet2/0
14.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 14.1.1.0/24 [90/2195456] via 13.1.1.1, 00:44:21, Ethernet2/0
D* 14.0.0.0/8 [90/281600] via 13.1.1.1, 00:44:04, Ethernet2/0
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:
!!!!!
r2#show ip route
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 12.1.1.1 to network 14.0.0.0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
D 13.1.1.0 [90/307200] via 12.1.1.1, 01:16:33, Ethernet2/0
14.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 14.1.1.0/24 [90/2195456] via 12.1.1.1, 00:45:28, Ethernet2/0
D* 14.0.0.0/8 [90/281600] via 12.1.1.1, 00:45:11, Ethernet2/0
r1#show ip nat tr
r1#show ip nat translations
Pro Inside global Inside local Outside local Outside global icmp 14.1.1.1:12 12.1.1.2:12 4.4.4.4:12 4.4.4.4:12 icmp 14.1.1.1:10 13.1.1.3:10 4.4.4.4:10 4.4.4.4:10
方法二,
r1(config)#no ip route 14.0.0.0 255.0.0.0 Null0
r1(config)#router ei 90
r1(config-router)#no net 14.0.0.0
r1(config-router)#end
r1#
*Mar 1 01:29:31.663: %SYS-5-CONFIG_I: Configured from console by console
r1#
r1#conf t
r1(config)#no ip default-network 14.0.0.0 删除方法一的配置,R2 R3中的默认路由没了
r2(config)#do show ip route
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
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
D 13.1.1.0 [90/307200] via 12.1.1.1, 01:18:48, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 12.1.1.1, 00:47:43, Ethernet2/0
r3#show ip route
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
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/307200] via 13.1.1.1, 01:18:26, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 13.1.1.1, 00:47:58, Ethernet2/0
r1(config)#ip route 0.0.0.0 0.0.0.0 s0/0 这里的默认路由要用出站的接口,用下一跳无效r 1(config)#router eigrp 90
r1(config-router)#net 0.0.0.0 0.0.0.0 通告0.0.0.0 0.0.0.0 网络
r2#show ip route
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 12.1.1.1 to network 0.0.0.0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
D 13.1.1.0 [90/307200] via 12.1.1.1, 01:23:18, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 12.1.1.1, 00:52:14, Ethernet2/0
D* 0.0.0.0/0 [90/2195456] via 12.1.1.1, 00:01:29, Ethernet2/0
r3#show ip route
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 13.1.1.1 to network 0.0.0.0
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/307200] via 13.1.1.1, 01:22:55, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 13.1.1.1, 00:52:28, Ethernet2/0
D* 0.0.0.0/0 [90/2195456] via 13.1.1.1, 00:01:42, Ethernet2/0
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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/150/300 ms
r2#
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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/146/240 ms
r3#
方法三
r1(config)#router eigrp 90
r1(config-router)#no net 0.0.0.0 0.0.0.0 删去方法二的配置,R2,R3的默认路由没了r2#show ip route
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
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
D 13.1.1.0 [90/307200] via 12.1.1.1, 01:24:56, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 12.1.1.1, 00:53:51, Ethernet2/0
r3#show ip route
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
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/307200] via 13.1.1.1, 01:24:32, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 13.1.1.1, 00:54:04, Ethernet2/0
r1(config)#router ei 90
r1(config-router)#redistribute static 重分布静态
r2#show ip route
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 12.1.1.1 to network 0.0.0.0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
D 13.1.1.0 [90/307200] via 12.1.1.1, 01:25:57, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 12.1.1.1, 00:54:52, Ethernet2/0
D*EX 0.0.0.0/0 [170/2195456] via 12.1.1.1, 00:00:20, Ethernet2/0
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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/127/236 ms r2#
r3#show ip route
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 13.1.1.1 to network 0.0.0.0
12.0.0.0/24 is subnetted, 1 subnets
D 12.1.1.0 [90/307200] via 13.1.1.1, 01:25:32, Ethernet2/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.1.1.0 is directly connected, Ethernet2/0
14.0.0.0/24 is subnetted, 1 subnets
D 14.1.1.0 [90/2195456] via 13.1.1.1, 00:55:05, Ethernet2/0
D*EX 0.0.0.0/0 [170/2195456] via 13.1.1.1, 00:00:33, Ethernet2/0
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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/132/204 ms r3#。