向EIGRP注入默认路由的三种方法
eigrp默认路由
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.44,但是如果内网不只R2,R3,有更多的设备,逐个的去配置默认路由工作比较大,因此我们这里实现R1自动向EIGRP 的网络内注入默认路由基本配置r2(config)#no ip do lor2(config)#line console 0r2(config-line)#no exec-tr2(config-line)#logg syr2(config-line)#inter e2/0r2(config-if)#ip add 12.1.1.2 255.255.255.0r2(config-if)#no shr2(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 upRouter(config)#host r3r3(config)#no ip do lor3(config)#line console 0r3(config-line)#no exec-tr3(config-line)#logg syr3(config-line)#inter e2/0r3(config-if)#ip add 13.1.1.3 255.255.255.0r3(config-if)#no shr3(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 InterfaceEthernet2/0, changed state to upr3(config-if)#Router(config)#host r1r1(config)#no ip do lor1(config)#line con 0r1(config-line)#no exec-timeoutr1(config-line)#logg synchronousr1(config)#inter e1/0r1(config-if)#ip add 12.1.1.1 255.255.255.0r1(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 upr1(config-if)#inter e1/1r1(config-if)#ip add 13.1.1.1 255.255.255.0r1(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 upr1(config-if)#endr1#ping*Mar 1 00:08:04.983: %SYS-5-CONFIG_I: Configured from console by consoler1#ping 12.1.1.2Type 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 msr1#ping 13.1.1.3Type 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 msr1#r1(config)#router ei 90r1(config-router)#no aur1(config-router)#net 12.1.1.0 0.0.0.255r1(config-router)#net 13.1.1.0 0.0.0.255r2(config)#router ei 90r2(config-router)#net 12.1.1.0 0.0.0.255r2(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 adjacencyr3(config)#router ei 90r3(config-router)#no aur3(config-router)#net 13.1.1.0 0.0.0.255r3(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 adjacencyr3(config-router)#r1(config)#inter s0/0r1(config-if)#clock ra 64000r1(config-if)#ip add 14.1.1.1 255.255.255.0r1(config-if)#no shr1(config-if)#endRouter(config)#host r4r4(config)#no ip do lor4(config)#line console 0r4(config-line)#no exec-tr4(config-line)#logg syr4(config-line)#r4(config-line)#inter s0/0r4(config-if)#ip add 14.1.1.4 255.255.255.0r4(config-if)#no sh*Mar 1 00:13:53.499: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upr4(config-if)#do ping 14.1.1.1Type 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 msr4(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 overloadr1(config)#inter s0/0r1(config-if)#ip nat outsider1(config-if)#inter e1/0r1(config-if)#ip nat insider1(config-if)#inter e1/1r1(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.1r3(config)#endr3#ping*Mar 1 00:31:04.067: %SYS-5-CONFIG_I: Configured from console by consoler3#ping 4.4.4.4Type 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.1r2(config)#endr2#ping 4.4.4.4Type 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 msr2#但是有时内部网络设备多,不能逐个去配置,这时eigrp 的默认路由就尤其重要了,在这里删了R2 ,R3默认路由,删完就不能与4.4.4.4能通信r2(config)#no ip route 0.0.0.0 0.0.0.0 12.1.1.1r2(config)#do ping 4.4.4.4Type 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.1r3(config)#do ping 4.4.4.4Type 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 routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsD 13.1.1.0 [90/307200] via 12.1.1.1, 00:24:25, Ethernet2/0r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set12.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/307200] via 13.1.1.1, 00:23:37, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Ethernet2/0方法一首先R1 要有一条前往14.1.1.0 的主类路由,下面查看R1的路由表,这个条路由中没有,因此要手工加用network命令通告到EIGRP然后ip default-network 将这条主路由配置为默认路由r1#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Ethernet1/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Ethernet1/114.0.0.0/24 is subnetted, 1 subnetsC 14.1.1.0 is directly connected, Serial0/0r1(config)#ip route 14.0.0.0 255.0.0.0 null 0 添加主类路由r1(config)#router ei 90r1(config-router)#net 14.0.0.0 在EIGRP中通告主类路由r1(config-router)#exitr1(config)#ip default-network 14.0.0.0 用ip default-network配置14.0.0.0为默认路由r3#ping 4.4.4.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:!!!!!r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 13.1.1.1 to network 14.0.0.012.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/307200] via 13.1.1.1, 01:14:49, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Ethernet2/014.0.0.0/8 is variably subnetted, 2 subnets, 2 masksD 14.1.1.0/24 [90/2195456] via 13.1.1.1, 00:44:21, Ethernet2/0D* 14.0.0.0/8 [90/281600] via 13.1.1.1, 00:44:04, Ethernet2/0r2#ping 4.4.4.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:!!!!!r2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 12.1.1.1 to network 14.0.0.012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsD 13.1.1.0 [90/307200] via 12.1.1.1, 01:16:33, Ethernet2/014.0.0.0/8 is variably subnetted, 2 subnets, 2 masksD 14.1.1.0/24 [90/2195456] via 12.1.1.1, 00:45:28, Ethernet2/0D* 14.0.0.0/8 [90/281600] via 12.1.1.1, 00:45:11, Ethernet2/0r1#show ip nat trr1#show ip nat translationsPro 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 Null0r1(config)#router ei 90r1(config-router)#no net 14.0.0.0r1(config-router)#endr1#*Mar 1 01:29:31.663: %SYS-5-CONFIG_I: Configured from console by consoler1#r1#conf tr1(config)#no ip default-network 14.0.0.0 删除方法一的配置,R2 R3中的默认路由没了r2(config)#do show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsD 13.1.1.0 [90/307200] via 12.1.1.1, 01:18:48, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 12.1.1.1, 00:47:43, Ethernet2/0r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set12.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/307200] via 13.1.1.1, 01:18:26, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 13.1.1.1, 00:47:58, Ethernet2/0r1(config)#ip route 0.0.0.0 0.0.0.0 s0/0 这里的默认路由要用出站的接口,用下一跳无效r 1(config)#router eigrp 90r1(config-router)#net 0.0.0.0 0.0.0.0 通告0.0.0.0 0.0.0.0 网络r2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 12.1.1.1 to network 0.0.0.012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsD 13.1.1.0 [90/307200] via 12.1.1.1, 01:23:18, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 12.1.1.1, 00:52:14, Ethernet2/0D* 0.0.0.0/0 [90/2195456] via 12.1.1.1, 00:01:29, Ethernet2/0r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 13.1.1.1 to network 0.0.0.012.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/307200] via 13.1.1.1, 01:22:55, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 13.1.1.1, 00:52:28, Ethernet2/0D* 0.0.0.0/0 [90/2195456] via 13.1.1.1, 00:01:42, Ethernet2/0r2#ping 4.4.4.4Type 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 msr2#r3#ping 4.4.4.4Type 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 msr3#方法三r1(config)#router eigrp 90r1(config-router)#no net 0.0.0.0 0.0.0.0 删去方法二的配置,R2,R3的默认路由没了r2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsD 13.1.1.0 [90/307200] via 12.1.1.1, 01:24:56, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 12.1.1.1, 00:53:51, Ethernet2/0r3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set12.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/307200] via 13.1.1.1, 01:24:32, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 13.1.1.1, 00:54:04, Ethernet2/0r1(config)#router ei 90r1(config-router)#redistribute static 重分布静态r2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 12.1.1.1 to network 0.0.0.012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsD 13.1.1.0 [90/307200] via 12.1.1.1, 01:25:57, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 12.1.1.1, 00:54:52, Ethernet2/0D*EX 0.0.0.0/0 [170/2195456] via 12.1.1.1, 00:00:20, Ethernet2/0r2#ping 4.4.4.4Type 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 routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 13.1.1.1 to network 0.0.0.012.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/307200] via 13.1.1.1, 01:25:32, Ethernet2/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Ethernet2/014.0.0.0/24 is subnetted, 1 subnetsD 14.1.1.0 [90/2195456] via 13.1.1.1, 00:55:05, Ethernet2/0D*EX 0.0.0.0/0 [170/2195456] via 13.1.1.1, 00:00:33, Ethernet2/0r3#ping 4.4.4.4Type 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#。
向RIP网络注入默认路由
实验目的:1、向RIP网络注入默认路由的三种方法;静态路由2、IP DEFAULT-NETWORK命令特征;3、重分布静态路由到RIP网络;4、DEFAULT-INFORMA TION ORIGINA TE命令特征(CCNA-E路由协议P165)实验原理:在路由器R1、R2和R3之间运行RIP V2,在R3和R4之间配置静态路由,R4模拟ISP,通过边界路由器R3的配置(三种办法),使得R1和R2学习到一条RIP默认路由。
实验步骤:(思科网络实验室CCNA实验指南,梁广民编著,P85)1、配置R1-R4每个端口IP地址,并且将端口打开。
2、配置R1、R2的RIP路由。
以R1为例,R2同理。
R1(CONFIG)#ROUTER RIPR1(CONFIG-ROUTER)#VERSION 2R1(CONFIG-ROUTER)#NO AUTO-SUMMARYR1(CONFIG-ROUTER)#NET 172.16.0.03、配置R3的RIP路由,并注入默认静态路由R3(CONFIG)#ROUTER RIPR3(CONFIG-ROUTER)#VERSION 2R3(CONFIG-ROUTER)#NO AUTO-SUMMARYR3(CONFIG-ROUTER)#NET 172.16.0.0R3(CONFIG)#IP ROUTE 0.0.0.0 0.0.0.0 S1/14、配置R4的静态路由R4(CONFIG)#IP ROUTE 172.16.0.0 255.255.0.0 S1/05、R1-R4上SHOW IP ROUTE,思考在R1上能否PING通192.168.4.4。
6、R3上通过IP DEFAULT-NETWORK 向RIP网络注入默认路由。
R3(CONFIG)#IP DEFAULT-NETWORK 192.168.34.07、然后在R1-R3上使用SHOW IP ROUTE 查看,思考。
若结果与课本不一致,使用CLEARIP ROUTE * 清空R1-R4路由表。
EIGRP默认路由总结
EIGRP默认路由总结实现EIGRP默认路由:方法1:写一条默认路由,重发布到EIGRP中R2(config)#ip route 0.0.0.0 0.0.0.0 s0/0 172.16.12.1 //使用出站接口和下一跳IP地址均可R2(config-router)#redistribute static metric 1544 20000 1 255 1500查看R3上的路由表如下:Gateway of last resort is 192.168.23.2 to network 0.0.0.0D 192.168.45.0/24 [90/2681856] via 192.168.34.4, 00:31:50, Ser ial0/1D 192.168.25.0/24 [90/2681856] via 192.168.23.2, 00:31:52, Ser ial0/0C 192.168.23.0/24 is directly connected, Serial0/0C 192.168.34.0/24 is directly connected, Serial0/1D*EX 0.0.0.0/0 [170/7289856] via 192.168.23.2, 00:00:05, Serial0/ 0默认路由条目以外部路由存在方法2:使用EIGRP特有的IP default-network宣告默认路由ip default-network 后的IP地址一定要是主类IP地址,并且处于所宣告该网段的接口的IP地址也必须的主类IP地址。
如果R2配置如下:router eigrp 10network 172.16.0.0network 192.168.23.0network 192.168.25.0no auto-summaryR2(config)#ip default-network 172.16.12.0则R2上show run会发现多处一条静态路由:ip route 172.16.0.0 255.25 5.0.0 172.16.12.0该静态路由是由宣告子网所造成的。
eigrp默认路由发布的4中方法
缺省路由发送第一种:R3(config)#ip route 0.0.0.0 0.0.0.0 e0/0R3(config)#router eigrp 100R3(config-router)#network 0.0.0.0R4#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 43.0.0.3 to network 0.0.0.050.0.0.0/24 is subnetted, 1 subnetsD 50.0.0.0 [90/307200] via 14.0.0.1, 00:11:57, Ethernet0/02.0.0.0/8 is subnetted, 1 subnetsD 2.0.0.0 [90/435200] via 14.0.0.1, 00:11:57, Ethernet0/03.0.0.0/24 is subnetted, 1 subnetsD 3.3.3.0 [90/409856] via 43.0.0.3, 00:00:50, Serial1/020.0.0.0/24 is subnetted, 1 subnetsD 20.0.0.0 [90/307456] via 43.0.0.3, 00:11:57, Serial1/043.0.0.0/24 is subnetted, 1 subnetsC 43.0.0.0 is directly connected, Serial1/010.0.0.0/24 is subnetted, 1 subnetsD 10.0.0.0 [90/307200] via 14.0.0.1, 00:11:57, Ethernet0/014.0.0.0/24 is subnetted, 1 subnetsC 14.0.0.0 is directly connected, Ethernet0/030.0.0.0/24 is subnetted, 1 subnetsD 30.0.0.0 [90/307456] via 43.0.0.3, 00:11:57, Serial1/0D* 0.0.0.0/0 [90/307456] via 43.0.0.3, 00:01:16, Serial1/0第二种:R3(config)#ip route 0.0.0.0 0.0.0.0 e0/0R3(config-router)#redistribute static metric 1 1 1 1 1R4#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 43.0.0.3 to network 0.0.0.050.0.0.0/24 is subnetted, 1 subnetsD 50.0.0.0 [90/307200] via 14.0.0.1, 00:14:49, Ethernet0/02.0.0.0/8 is subnetted, 1 subnetsD 2.0.0.0 [90/435200] via 14.0.0.1, 00:14:49, Ethernet0/020.0.0.0/24 is subnetted, 1 subnetsD 20.0.0.0 [90/307456] via 43.0.0.3, 00:14:49, Serial1/043.0.0.0/24 is subnetted, 1 subnetsC 43.0.0.0 is directly connected, Serial1/010.0.0.0/24 is subnetted, 1 subnetsD 10.0.0.0 [90/307200] via 14.0.0.1, 00:14:49, Ethernet0/014.0.0.0/24 is subnetted, 1 subnetsC 14.0.0.0 is directly connected, Ethernet0/030.0.0.0/24 is subnetted, 1 subnetsD 30.0.0.0 [90/307456] via 43.0.0.3, 00:14:49, Serial1/0D*EX 0.0.0.0/0 [170/2560026112] via 43.0.0.3, 00:00:08, Serial1/0第三种:R3(config)#interface s1/0R3(config-if)#ip summary-address eigrp 100 0.0.0.0 0.0.0.0R4#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 43.0.0.3 to network 0.0.0.050.0.0.0/24 is subnetted, 1 subnetsD 50.0.0.0 [90/307200] via 14.0.0.1, 00:00:08, Ethernet0/02.0.0.0/8 is subnetted, 1 subnetsD 2.0.0.0 [90/435200] via 14.0.0.1, 00:00:08, Ethernet0/020.0.0.0/24 is subnetted, 1 subnetsD 20.0.0.0 [90/332800] via 14.0.0.1, 00:00:08, Ethernet0/043.0.0.0/24 is subnetted, 1 subnetsC 43.0.0.0 is directly connected, Serial1/010.0.0.0/24 is subnetted, 1 subnetsD 10.0.0.0 [90/307200] via 14.0.0.1, 00:00:08, Ethernet0/014.0.0.0/24 is subnetted, 1 subnetsC 14.0.0.0 is directly connected, Ethernet0/030.0.0.0/24 is subnetted, 1 subnetsD 30.0.0.0 [90/358400] via 14.0.0.1, 00:00:09, Ethernet0/0D* 0.0.0.0/0 [90/307456] via 43.0.0.3, 00:00:07, Serial1/0第四种:R3(config)#router eigrp 100R3(config-router)#network 30.0.0.0 0.0.0.255R3(config-router)#exitR3(config)#ip default-network 30.0.0.0R4#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set50.0.0.0/24 is subnetted, 1 subnetsD 50.0.0.0 [90/307200] via 14.0.0.1, 00:02:08, Ethernet0/02.0.0.0/8 is subnetted, 1 subnetsD 2.0.0.0 [90/435200] via 14.0.0.1, 00:02:08, Ethernet0/020.0.0.0/24 is subnetted, 1 subnetsD 20.0.0.0 [90/307456] via 43.0.0.3, 00:02:08, Serial1/043.0.0.0/24 is subnetted, 1 subnetsC 43.0.0.0 is directly connected, Serial1/010.0.0.0/24 is subnetted, 1 subnetsD 10.0.0.0 [90/307200] via 14.0.0.1, 00:02:08, Ethernet0/014.0.0.0/24 is subnetted, 1 subnetsC 14.0.0.0 is directly connected, Ethernet0/030.0.0.0/24 is subnetted, 1 subnetsD* 30.0.0.0 [90/307456] via 43.0.0.3, 00:00:05, Serial1/0。
三种动态路由协议下发默认路由的方式
RIP:(边界路由)
1.重分布静态路由re distribute static
2.default-intformation originate
3.缺省路由ip default-network (宣告主类网络号)
4.在RIP进程中宣告缺省路由network 0.0.0.0
5.在接口下汇总默认路由ip summary-address rip 0.0.0.0 0.0.0.0
EIGRP:(边界路由)
1.重分布静态路由re distribute static
2.缺省路由ip default-network (宣告主类网络号),同时在进程下宣告主类网络号,另外在连接内网的接口下采用手动汇总该外部路由
3.在EIGRP进程中宣告缺省路由network 0.0.0.0
4.全网使用静态路由实现逻辑全互联(不推荐)
OSPF:(边界路由)
使用default-information originate 必须在路由表中手动添加缺省指向NULL 0
default-information originate always----->强制添加缺省路由进入路由表
OSPF来说,它和距离矢量协议是不一样的,它的路径计算是基于SPF算法的,是通过LSA 来泛红路由,如果想在ospf内重分布默认路由的话,那么就需要配合使用default-information originate这个命令,因为ospf是只能重分布非缺省状态的静态路由,如果要是没有配置缺省路由的话,那么就要在default-information originate 后面加个always,就是无论本路由器路由表里有没有默认路由,都会广播出去。
思科认证:eigrp注入默认路由的三种方式
⼀、静态重分布静态重分布是最简单的⼀种⽅式,只需要在路由器上配置两条命令就可以。
⾸先在R1上添加默认路由,然后在eigrp中使⽤redistribute命令。
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0 //添加默认路由R1(config)#router eigrp 90R1(config-router)#redistribute static //静态重分布⼆、通告默认路由这⼀种⽅式相对也⽐较简单。
通告默认路由就是把默认路由像普通段那样宣告到eigrp进程中去。
既然是通告默认路由,那⾸先得有⼀条默认路由。
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0 //添加默认路由R1(config)#router eigrp 90R1(config-router)#network 0.0.0.0 // 宣告默认路由三、ip default-networkip default-network 命令只⽀持有类IP,所以,在使⽤这种⽅式的时候,应该讲使⽤该段对应的主类络号。
⽐如本拓扑中应该使⽤12.0.0.0配置脚本如下:R1(config)#ip default-network 12.0.0.0 //使⽤ip default-network 声明默认路由R1(config)#router eigrp 90R1(config-router)#network 12.0.0.0 //声明该段R1(config-router)#exitR1(config)#ip route 12.0.0.0 255.0.0.0 null 0最后⼀条就需要注意了,在使⽤这种⽅法的时候,需要保证本机路由表中有对应的表项。
但是我们的12段是24位掩码,⽽ip default-network 声明的是主类络号,8位的掩码。
EIGRP注入静态配置
一EIGRP注入路由的方法1,重分布R1配置R1#show run | beg interinterface Loopback0ip address 1.1.1.1 255.255.255.255!interface FastEthernet0/0no ip addressshutdownduplex half!interface Serial1/0ip address 12.1.1.1 255.255.255.0serial restart-delay 0R1#show running-config | begin eigrprouter eigrp 100network 12.1.1.0 0.0.0.255network 0.0.0.0auto-summary!ip route 0.0.0.0 0.0.0.0 Serial1/0R2配置interface Loopback0ip address 2.2.2.2 255.255.255.255 !interface FastEthernet0/0no ip addressshutdownduplex half!interface Serial1/0ip address 12.1.1.2 255.255.255.0 serial restart-delay 0!interface Serial1/1ip address 23.1.1.2 255.255.255.0 serial restart-delay 0!router eigrp 100network 2.2.2.2 0.0.0.0network 12.1.1.0 0.0.0.255network 23.1.1.0 0.0.0.255auto-summaryR3配置interface Loopback0ip address 3.3.3.3 255.255.255.255 !interface FastEthernet0/0no ip addressshutdownduplex half!interface Serial1/0ip address 23.1.1.3 255.255.255.0 serial restart-delay 0router eigrp 100redistribute staticnetwork 23.1.1.0 0.0.0.255no auto-summary!ip route 0.0.0.0 0.0.0.0 Serial1/0 !2宣告静态R1配置:interface Loopback0ip address 1.1.1.1 255.255.255.255 !interface FastEthernet0/0no ip addressshutdownduplex half!interface Serial1/0ip address 12.1.1.1 255.255.255.0 serial restart-delay 0R1#show run | se r erouter eigrp 100network 1.0.0.0network 12.1.1.0 0.0.0.255auto-summaryR2配置:R2#show run | beg interinterface Loopback0ip address 2.2.2.2 255.255.255.255 !interface FastEthernet0/0no ip addressshutdownduplex autospeed auto!interface FastEthernet0/1no ip addressshutdownduplex autospeed auto!interface Serial1/0ip address 12.1.1.2 255.255.255.0 serial restart-delay 0!interface Serial1/1ip address 23.1.1.2 255.255.255.0 serial restart-delay 0!R2#show run | se r erouter eigrp 100network 2.0.0.0network 3.0.0.0network 12.1.1.0 0.0.0.255network 23.1.1.0 0.0.0.255auto-summaryR2#show run | beg ip routeip route 3.3.3.0 255.255.255.0 Serial1/1 !!R3配置:R3#show run | beg interinterface Loopback0ip address 3.3.3.3 255.255.255.255!interface Serial1/0ip address 23.1.1.3 255.255.255.0serial restart-delay 0!R3#show run | se r erouter eigrp 100network 23.1.1.0 0.0.0.255auto-summary测试:在R1上ping 3.3.3.3R1#ping 3.3.3.3Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 52/64/76 ms查看EIGRP拓扑表:R1#show ip eigrp topologyIP-EIGRP Topology Table for AS(100)/ID(1.1.1.1)Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,r - reply Status, s - sia StatusP 1.1.1.1/32, 1 successors, FD is 128256via Connected, Loopback0P 1.0.0.0/8, 1 successors, FD is 128256via Summary (128256/0), Null0P 2.0.0.0/8, 1 successors, FD is 2297856via 12.1.1.2 (2297856/128256), Serial1/0P 3.3.3.0/24, 1 successors, FD is 2681856via 12.1.1.2 (2681856/2169856), Serial1/0P 12.0.0.0/8, 1 successors, FD is 2169856via Summary (2169856/0), Null0P 12.1.1.0/24, 1 successors, FD is 2169856via Connected, Serial1/0P 23.0.0.0/8, 1 successors, FD is 2681856via 12.1.1.2 (2681856/2169856), Serial1/0查看EIGRP路由表:R1#show ip route eigrp1.0.0.0/8 is variably subnetted, 2 subnets, 2 masksD 1.0.0.0/8 is a summary, 00:24:03, Null0D 2.0.0.0/8 [90/2297856] via 12.1.1.2, 00:22:26, Serial1/03.0.0.0/24 is subnetted, 1 subnetsD 3.3.3.0 [90/2681856] via 12.1.1.2, 00:22:52, Serial1/0D 23.0.0.0/8 [90/2681856] via 12.1.1.2, 00:22:34, Serial1/012.0.0.0/8 is variably subnetted, 2 subnets, 2 masksD 12.0.0.0/8 is a summary, 00:24:03, Null03,通过 ip Default-Network注入:R1配置:interface Loopback0ip address 1.1.1.1 255.255.255.255 !interface FastEthernet0/0no ip addressshutdownduplex half!interface Serial1/0ip address 12.1.1.1 255.255.255.0 serial restart-delay 0R1#show run | se r erouter eigrp 100network 1.0.0.0network 12.1.1.0 0.0.0.255auto-summaryR2配置:R2#show run | beg interinterface Loopback0ip address 2.2.2.2 255.255.255.255 !interface FastEthernet0/0no ip addressshutdownduplex autospeed auto!interface FastEthernet0/1no ip addressshutdownduplex autospeed auto!interface Serial1/0ip address 12.1.1.2 255.255.255.0 serial restart-delay 0!interface Serial1/1ip address 23.1.1.2 255.255.255.0 serial restart-delay 0!R2#show run | begin eigrprouter eigrp 100network 2.0.0.0network 3.0.0.0network 12.1.1.0 0.0.0.255network 23.1.1.0 0.0.0.255auto-summary!no ip http serverno ip http secure-serverip default-network 3.0.0.0ip route 3.0.0.0 255.0.0.0 Null0R3配置:R3#show run | beg interinterface Loopback0ip address 3.3.3.3 255.255.255.255 !interface Serial1/0ip address 23.1.1.3 255.255.255.0serial restart-delay 0!R3#show run | se r erouter eigrp 100network 23.1.1.0 0.0.0.255auto-summary测试:在R1上查看EIGRP路由表:R1#show ip route eigrp1.0.0.0/8 is variably subnetted, 2 subnets, 2 masksD 1.0.0.0/8 is a summary, 00:35:32, Null0D 2.0.0.0/8 [90/2297856] via 12.1.1.2, 00:33:56, Serial1/0 D 3.0.0.0/8 [90/2169856] via 12.1.1.2, 00:00:03, Serial1/0D 23.0.0.0/8 [90/2681856] via 12.1.1.2, 00:34:03, Serial1/012.0.0.0/8 is variably subnetted, 2 subnets, 2 masksD 12.0.0.0/8 is a summary, 00:35:32, Null0。
RIP传递默认路由的5种方法
RIP传递默认路由的5种方法在一个单出口网络内启用RIP协议,在网络出口处的路由器需要向RIP域内传播一条默认路由,这样,域内的路由器就可以通过默认路由访问外部网络。
下面我们就用试验来模拟这个环境。
到目前为止;通过RIP传递默认路由共有5种方法。
1 default-information2 手工写一条默认路由(到NULL0)然后重分布到RIP中3 手工写一条默认路由(到NULL0)在进程中宣告4 ip default-network5 在接口汇总 0.0.0.0/0 到NULL0的路由***************************************************************************************************************以下内容需要回复才能看到一路由器基本配置R1interface Loopback0ip address 1.1.1.1 255.255.255.0interface Serial1/0ip address 12.0.0.1 255.255.255.0router ripversion 2network 1.0.0.0network 12.0.0.0no auto-summary------------------R2interface Serial1/0ip address 12.0.0.2 255.255.255.0interface Serial1/1ip address 23.0.0.2 255.255.255.0router ripversion 2network 2.0.0.0network 12.0.0.0no auto-summary------------------R3interface Serial1/0ip address 23.0.0.3 255.255.255.0**************************************************************************************************************二方法1 default-informationr2#sh run | b r rrouter ripversion 2network 2.0.0.0network 12.0.0.0default-information originateno auto-summaryr1#sh ip rou1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback012.0.0.0/24 is subnetted, 1 subnetsC 12.0.0.0 is directly connected, Serial1/0R* 0.0.0.0/0 [120/1] via 12.0.0.2, 00:00:09, Serial1/0 /可以看到这时在R1上产生了一条默认路由r1#ping 23.0.0.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.0.0.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 28/41/68 ms----------------------------------------此外,在default-information originate可以调用一个route-map来匹配一个接口或路由,当这个路由有效的时候才会传递默认路由。
eigrp协议配置及路由重发布静态路由
Eigrp的配置以及路由的重发布目的:掌握路由Eigrp的配置以及路由重发布准备:先配置一条以eigrp协议运行的链路PC1——R1——R2——R3——PC2设备基础配置:PC1的配置如下:路由器R1的配置如下:Router1>enRouter1#conf tEnter configuration commands, one per line. End with CNTL/Z.Router1(config)#int f0/0Router1(config-if)#ip address 192.168.1.2 255.255.255.0Router1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up Router1(config-if)#int f0/1Router1(config-if)#ip add 172.168.1.1 255.255.255.0Router1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up路由器R2的配置如下:Router2>enRouter2#conf tEnter configuration commands, one per line. End with CNTL/Z.Router2(config)#int f0/0Router2(config-if)#ip add 172.168.1.2 255.255.255.0Router2(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouter2(config-if)#int f0/1Router2(config-if)#ip add 172.168.2.1 255.255.255.0Router2(config-if)#no shRouter2(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up路由器R3的配置如下:Router3>enRouter3#conf tEnter configuration commands, one per line. End with CNTL/Z.Router3(config)#int f0/1Router3(config-if)#ip add 172.168.2.2 255.255.255.0Router3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upRouter3(config-if)#int f0/0Router3(config-if)#ip add 192.168.2.2 255.255.255.0Router3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up PC2的配置如下:下面先验证下相邻设备之间是否可以通行经检验以上设置可以使PC1——R1——R2——R3——PC2链路中的相邻设备间互相通信接下来在R1,R2,R3 三台路由器中配置eigrp路由协议配置EIGRP语法:在全局模式下输入route eigrp 【as-number】R1配置如下:Router1(config-if)#exitRouter1(config)#route eigrp 100Router1(config-router)#net 192.168.1.0 0.0.0.255Router1(config-router)#net 172.168.1.0 0.0.0.255配置完R1看下配置是否生效:Router1(config-router)#end%SYS-5-CONFIG_I: Configured from console by consoleRouter1#show runBuilding configuration...Current configuration : 519 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Router1!!!!!!!!!!!!!!!!!!interface FastEthernet0/0ip address 192.168.1.2 255.255.255.0 duplex autospeed auto!interface FastEthernet0/1ip address 172.168.1.1 255.255.255.0 duplex autospeed auto!router eigrp 100network 192.168.1.0network 172.168.1.0 0.0.0.255auto-summary!ip classless!!!!!!!line con 0line vty 0 4login!!!End看见运行配置中以上配置eigrp协议生效同理在R2,R3中配置eigrp协议R2的配置如下:Router2#conf tEnter configuration commands, one per line. End with CNTL/Z.Router2(config)#route eig 100Router2(config-router)#net 172.168.1.0 0.0.0.255%DUAL-5-NBRCHANGE: IP-EIGRP 100:Neighbor 172.168.1.1 (FastEthernet0/0) is up: new adjacencyRouter2(config-router)#net 172.168.2.0 0.0.0.255R3的配置如下:Router3(config)#rout eigrp 100Router3(config-router)#net 192.168.2.0 0.0.0.255Router3(config-router)#net 172.168.2.0 0.0.0.255Router3(config-router)#%DUAL-5-NBRCHANGE: IP-EIGRP 100:Neighbor 172.168.2.1 (FastEthernet0/1) is up: new adjacencyeigrp协议配置好后。
通告默认路由
实验一:RIP路由器R3没有往内部通告(发布)默认路由之前:R3(config-router)# default-information originate后:R3、R4不变。
实验二:OSPF也可以用R3(config-router)# default-information originate always 通告进OSPF区域通告前:通告后:实验三:ip default-network的应用(1)路由器R1、R2和R3都运行RIP路由协议R1——network通告172.16.0.0和10.0.0.0R2——network只通告10.0.0.0,不通告192.168.1.0R3——network通告172.16.0.0和10.0.0.0(2)在路由器R1的s0/0接口上配置rip汇总:R1(config-if)#ip summary-address rip 172.16.0.0 255.255.252.0 (3)在路由器R3的s0/1接口上配置rip汇总:R3(config-if)#ip summary-address rip 172.16.4.0 255.255.252.0(4)在R2上配置一条:R2(config)#ip default-network 192.168.1.0 在R2上通告一条默认路由实验四:R4(config)#ip route 0.0.0.0 0.0.0.0 202.0.0.2 //默认路由(或指向出接口)R4(config)#ip default-network 202.0.0.0 //向内部rip网络通告一条默认路由(ip default-network+出口那个网段)为什么default-network是202.0.0.0网络呢?因为默认路由的下一跳是这个网络,告诉内部rip进程:去往未知网络就要通过这个网络。
否则,无法将默认路由通告到内部rip进程中。
注意:只配置R4(config)#ip default-network 202.0.0.0,不配置:R4(config)#ip route 0.0.0.0 0.0.0.0 202.0.0.2,结果会是:内部路由器只能ping通202.0.0.2 。
配置EIGRP的默认网络
使用IP default-network 配置EIGRP的默认网络一、实验拓扑二、设备配置2.1R1模拟外部网络配置如下R1R1>enR1#conf tR1(config)#int e 1/0R1(config-if)#ip add 12.1.1.1 255.255.255.0R1(config-if)#no shR1(config-if)#int lo 0R1(config-if)#ip add 172.16.0.1 255.255.255.0R1(config-if)#int lo 1R1(config-if)#ip add 172.16.1.1 255.255.255.0 R1(config-if)#int lo 2R1(config-if)#ip add 172.16.2.1 255.255.255.0 R1(config-if)#int lo 3R1(config-if)#ip add 172.16.3.1 255.255.255.0 R1(config-if)#ip route 0.0.0.0 0.0.0.0 12.1.1.2R1(config)#2.2EIGRP 域内路由器配置R2R2>enR2#conf tR2(config)#int e 1/0R2(config-if)#ip add 12.1.1.2 255.255.255.0R2(config-if)#no shR2(config-if)#int e 1/1R2(config-if)#ip add 23.1.1.2 255.255.255.0R2(config-if)#no shR2(config-if)#int e 1/2R2(config-if)#ip add 24.1.1.2 255.255.255.0R2(config-if)#no shR2(config-if)#router ei 50R2(config-router)#net 23.1.1.0 0.0.0.255R2(config-router)#net 24.1.1.0 0.0.0.255R2(config-router)#R3R3>enR3#conf tR3(config)#int e 1/0R3(config-if)#ip add 23.1.1.3 255.255.255.0R3(config-if)#no shR3(config-if)#router ei 50R3(config-router)#net 23.1.1.0 0.0.0.255R3(config-router)#R4R4>enR4#conf tR4(config)#int e 1/0R4(config-if)#ip add 24.1.1.4 255.255.255.0R4(config-if)#no shR4(config-if)#router ei 50R4(config-router)#net 24.1.1.0 0.0.0.255三、验证3.1EIGRP邻居关系已经建立R2(config-router)#do show ip ei neiIP-EIGRP neighbors for process 50H Address Interface Hold Uptime SRTT RTO Q Seq(sec) (ms) Cnt Num1 24.1.1.4 Et1/2 11 00:00:50 115 690 0 30 23.1.1.3 Et1/1 11 00:01:34 82 492 0 3R2(config-router)#✧在R2上配置用于到达外部网络的静态路由R2(config-router)#R2(config-router)#ip route 0.0.0.0 0.0.0.0 12.1.1.1R2(config)#✧R2可以到达外部网络R2(config)#do ping 172.16.0.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:.!!!!Success rate is 80 percent (4/5), round-trip min/avg/max = 28/46/72 ms R2(config)#3.2R3和R4没有路由无法访问外网R3(config-router)#do show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, Ethernet1/0D 24.0.0.0/8 [90/307200] via 23.1.1.2, 00:04:11, Ethernet1/0R3(config-router)#R4(config-router)#do show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setD 23.0.0.0/8 [90/307200] via 24.1.1.2, 00:03:41, Ethernet1/024.0.0.0/24 is subnetted, 1 subnetsC 24.1.1.0 is directly connected, Ethernet1/0R4(config-router)#3.3使用IP default-network在R2上使用IP default-network配置默认网络R2(config-router)#router ei 50R2(config)#router ei 50R2(config-router)#network 12.0.0.0R2(config-router)#ip default-network 12.0.0.0R2(config)#do show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 12.1.1.1 to network 0.0.0.023.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 23.1.1.0/24 is directly connected, Ethernet1/1D 23.0.0.0/8 is a summary, 00:00:26, Null0 //24.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 24.1.1.0/24 is directly connected, Ethernet1/2D 24.0.0.0/8 is a summary, 00:00:26, Null0* 12.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 12.1.1.0/24 is directly connected, Ethernet1/0D* 12.0.0.0/8 is a summary, 00:00:12, Null0 //eigrp 默认网络S* 0.0.0.0/0 [1/0] via 12.1.1.1 //静态默认路由R2(config)#R3(config)#do show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 23.1.1.2 to network 12.0.0.023.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, Ethernet1/0D 24.0.0.0/8 [90/307200] via 23.1.1.2, 00:43:38, Ethernet1/0D* 12.0.0.0/8 [90/307200] via 23.1.1.2, 00:02:33, Ethernet1/0//R3已经学到了默认路由3.4测试连通性R3(config)#R3(config)#do ping 172.16.0.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 44/66/92 msR3(config)#备注:使用ip default-network 通告的路由,前提是必须先把接口的主类网络宣告进EIGRP进程中,否则EIGRP无法通告该条默认路由。
向EIGRP网络注入默认路由
实验目的:1、向EIGRP网络注入默认路由的方法;2、IP DEFAULT-NETWORK命令特征;实验原理:在路由器R1、R2和R3之间运行EIGRP,R3和R4之间配置静态路由,R4模拟ISP,通过边界路由器R3的配置(三种办法),使得R1和R2学习到一条RIP默认路由。
实验步骤:(思科网络实验室CCNA实验指南,梁广民编著,P109)1、配置R1-R4每个端口IP地址,并且将端口打开。
2、配置R1的EIGRP路由。
R1(CONFIG)#ROUTER EIGRP 1R1(CONFIG-ROUTER)#NO AUTO-SUMMARYR1(CONFIG-ROUTER)#NET 172.16.1.0 255.255.255.0R1(CONFIG-ROUTER)#NET 172.16.12.0 255.255.255.03、配置R2的EIGRP路由。
R2(CONFIG)#ROUTER EIGRP 1R2(CONFIG-ROUTER)#NO AUTO-SUMMARYR2(CONFIG-ROUTER)#NET 172.16.12.0 255.255.255.0R2(CONFIG-ROUTER)#NET 172.16.23.0 255.255.255.04、配置R3的RIP路由,并注入默认静态路由R3(CONFIG)#ROUTER EIGRP 1R3(CONFIG-ROUTER)#NO AUTO-SUMMARYR3(CONFIG-ROUTER)#NET 192.168.34.0R3(CONFIG-ROUTER)#NET 172.23.0.0 255.255.255.0R3(CONFIG)#IP ROUTE 0.0.0.0 0.0.0.0 S1/15、配置R4的静态路由R4(CONFIG)#IP ROUTE 172.16.0.0 255.255.0.0 S1/06、R1-R4上SHOW IP ROUTE,思考在R1上能否PING通192.168.4.4。
eigrp默认路由
Eigrp默认路由配置实验目的:1、掌握通过ip default-network命令配置EIGRP默认网络。
实验拓扑图:实验步骤及要求:1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、配置R3路由器用于模拟外部网络,也可以把其假想为Internet网络,并且在R3上配置一条默认用于,以便路由来自于EIGRP内部网络的数据包。
3、配置R1、R2和R5路由器的EIGRP路由协议,配置如下所示:4、在R2上查看EIGRP的邻居,确认EIGRP正常运行:5、在R2上配置静态默认路由,用于到达外部网络,配置如下:6、路由器R2作为企业的出口路由器,由于其配置了静态路由,因此其可以直接访问外部,但是内部的R1和R5路由器由于缺少路由,因此无法访问外网。
下面显示了R1路由器的路由表和其向外部发起ping的访问结果:7、为了解决问题,只需要在R1和R5路由器上配置一条指向R2路由器的静态默认路由即可,如下所示:8、根据上面配置,其实只需要给内部路由器配置默认路由指向出口路由器R2即可解决外部网络无法访问的问题。
但是如果内部网络路由器数量较多时,采用手工配置静态默认路由,则会显得非常繁锁。
因此,建议采用默认网络命令,让R2路由器自动的向内部通告默认路由。
9、将R1和R5的静态默认路由删除后,查看R1和R5的路由表。
如下所示:10、在R2上配置默认网络,配置如下所示:11、查看R1和R5路由器的路由表,并且尝试访问外部网络:12、使用ip default-network命令可以有效减少内部网络配置任务。
不过需要注意的是ip default-network其指出默认网络,建议采用主类网络。
如果使用无类网络,则可能会出现无法解释的问题。
13、实验完成。
eigrp默认路由总结
拓扑R1(s1/2)----------------(s1/3) R2 (s1/2)---------------------(s1/3) R31:写一条默认路由,network到EIGRP进程ip route 0.0.0.0 0.0.0.0 interface (接口必须是up而且要有address,或者是null0,也可以是lookback接口)router eigrp ASnetwork 0.0.0.0缺点:会在宣告的路由器上,将所有接口激活.包括你不想激活的接口注意在RIP中创建的默认路由不会从所跟的接口和能到达下跳地址的接口传递出去但是EIGRP可以这个是因为水平分割在RIP中是默认关闭的而EIGRP 不是。
R2(config)#ip route 0.0.0.0 0.0.0.0 null 0R2(config)#router eigrp 1R2(config-router)#network 0.0.0.02:写一条默认路由,重分布静态到EIGRP进程ip route 0.0.0.0 0.0.0.0 interface(下一跳可以是出口标识,也可以是下一跳ip地址。
接口必须是up而且要有address或者是null0)router eirp ASredistribute static metric 10000 100 255 1 1500默认路由出现的形式D*EX,AD=170和RIP的对比和第1种方法一样。
R2(config)#ip route 0.0.0.0 0.0.0.0 null 0R2(config)#router eigrp 1R2(config-router)#redistribute static metric 10000 100 255 1 15003 汇总一条0.0.0.0 的路由,本地会产生一条null0的0.0.0.0的路由接口下手工汇总ip summary-address eirp 90 0.0.0.0 0.0.0.0 ,在连接eigrp内部router的接口上汇总0.0.0.0的默认路由会传递给接口连接的邻居(不在乎auto/no auto-summary/也不需要写静态)缺点:具有方向性.具有抑制明细的特点。
02EIGRP重发布静态产生默认路由
实验二 EIGRP 重发布静态产生默认路由说明:地址依然是1.0/24,12.0/24,23.0/24和3.0/24,R1,R2模拟内部网络,R2作为边界路由器去往外部网络需要配置默认路由,并向内部网络注入默认路由,R3模拟外部网络,为了能访问内部网络,也需要配置静态路由或默认路由,此处使用的是默认路由,最终的效果是R1不需要手动配置默认路由也可以在路由表中看到默认路由的出现,并且可以和R3后面的3.0通信。
R1:EnConf thostname r1!interface Loopback0ip address 192.168.1.1 255.255.255.0!!interface Serial1/2ip address 192.168.12.1 255.255.255.0no shut!!router eigrp 90network 192.168.0.0 0.0.255.255no auto-summary!EndR2:EnConf tHo r2hostname r2!interface Serial1/2ip address 192.168.23.2 255.255.255.0 no shut!interface Serial1/3ip address 192.168.12.2 255.255.255.0 no shut!router eigrp 90network 192.168.12.0no auto-summary!ip http serverno ip http secure-serverip route 0.0.0.0 0.0.0.0 Serial1/2!!EndR3:EnConf thostname r3interface Loopback0ip address 192.168.3.3 255.255.255.0 !interface Serial1/3ip address 192.168.23.3 255.255.255.0 no shut!ip http serverno ip http secure-serverip route 0.0.0.0 0.0.0.0 Serial1/3!end此时分别查看三台路由器的路由表,R1:R2:R3:显然ping192.168.3.3是不通的(没有路由)。
思科认证:eigrp注入默认路由的三种方式
思科认证:eigrp注入默认路由的三种方式一、静态重分布静态重分布是最简单的一种方式,只需要在路由器上配置两条命令就能够。
首先在R1上添加默认路由,然后在eigrp中使用redistribute 命令。
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0 //添加默认路由R1(config)#router eigrp 90R1(config-router)#redistribute static //静态重分布二、通告默认路由这个种方式相对也比较简单。
通告默认路由就是把默认路由像普通网段那样宣告到eigrp进程中去。
既然是通告默认路由,那首先得有一条默认路由。
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0 //添加默认路由R1(config)#router eigrp 90R1(config-router)#network 0.0.0.0 // 宣告默认路由三、ip default-networkip default-network 命令只支持有类IP,所以,在使用这种方式的时候,应该讲使用该网段对应的主类网络号。
比如本拓扑中应该使用12.0.0.0配置脚本如下:R1(config)#ip default-network 12.0.0.0 //使用ip default-network 声明默认路由R1(config)#router eigrp 90R1(config-router)#network 12.0.0.0 //声明该网段R1(config-router)#exitR1(config)#ip route 12.0.0.0 255.0.0.0 null 0最后一条就需要注意了,在使用这种方法的时候,需要保证本机路由表中有对应的表项。
但是我们的12网段是24位掩码,而ip default-network 声明的是主类网络号,8位的掩码。
实验EIGRP默认网络的配置
实验EIGRP默认网络的配置R1、R2、R3 运行EIGRP,用ip default-network 命令使EIGRP 传递缺省路由,各路由器的各环回口之间互相路由可达。
实验步骤(1) 内部网络 R1、R2、R3 配置EIGRP。
R1配置R1(config)#router eigrp 10R1(config-router)#no auto-summaryR1(config-router)#network 11.1.1.0 0.0.0.255R1(config-router)#network 12.1.1.0 0.0.0.255R2 配置R2(config)#router eigrp 10R2(config-router)#no auto-summaryR2(config-router)#network 22.1.1.0 0.0.0.255R2(config-router)#network 12.1.1.0 0.0.0.255R2(config-router)#network 23.1.1.0 0.0.0.255R3 配置R3(config)#router eigrp 10R3(config-router)#no auto-summaryR3(config-router)#network 33.1.1.0 0.0.0.255R3(config-router)#network 23.1.1.0 0.0.0.255在各台路由器上查看拓扑表、路由表,并互相ping测试自治域内各路由器环回口的连通性。
(2) R3 做内部网络的出口路由器,R4 做外部路由器,分别配置往返内外网的静态路由。
R1 配置R3(config)#ip route 0.0.0.0 0.0.0.0 34.1.1.4R4 配置R4(config)#ip route 11.1.1.0 255.255.255.0 34.1.1.3R4(config)#ip route 22.1.1.0 255.255.255.0 34.1.1.3R4(config)#ip route 33.1.1.0 255.255.255.0 34.1.1.3测试 R1、R2、R3 到外部网络的连通性。
Eigrp下放默认路由和负载均衡
Eigrp备注:lo 1 不加入路由进程中R1上下放默认路由:(1)R1(config)#ip route 0.0.0.0 0.0.0.0 null0R1(config-router)#redistribute staticR2#sh ip route测试:(2)R1(config)#ip route 0.0.0.0 0.0.0.0 null0R1(config)#router eigrp 1R1(config-router)#net 0.0.0.0 0.0.0.0测试:R4#show ip route(3)R1(config)#ip default-network 200.200.200.0R1(config)#router eigrp 1R1(config-router)#net 200.200.200.0 0.0.0.255 (主类网络)R3#sh ip route(4)R1(config-if)#int s1/0R1(config-if)#ip summary-address eigrp 1 0.0.0.0 0.0.0.0R3#show ip routeR1(config-if)#int E0/0R1(config-if)#ip summary-address eigrp 1 0.0.0.0 0.0.0.0R3#show ip route//两同时加入,则以e0/0为准,因为快速以太网延迟小,所以度量小。
负载均衡:R3上面看到达1.1.1.1的路由:非等价负载均衡:首先先查看R3的拓扑表:R4(config-if)#do show ipeigrptopoR4(config)#routereigrp 1R4(config-router)#variance 2 (variance 取值范围:1-128) 查看路由表的结果。
通过R3(config-router)#do show ip route 1.1.1.1查看数据包的分配。