简单的配置使网络互通,使R1,R2,R3,R4能互相学到路由。

 

我们用debug观察正常情况下,若网络中其它任一节点出现故障,路由器向每个路由器都发送查询Ruery.

 

将R3的loop端口关闭

r3#
r3(config)#int loopback 0
r3(config-if)#shutdown
r3#


在R4上用debug查看
r4#
r4#debug ip eigrp
IP-EIGRP Route Events debugging is on
r4#
r4#
*Mar  1 00:19:38.727: IP-EIGRP(Default-IP-Routing-Table:100): Processing incomin
QUERY packet
*Mar  1 00:19:38.731: IP-EIGRP(Default-IP-Routing-Table:100): Int 3.3.3.3/32 M 4
294967295 - 0 4294967295 SM 4294967295 - 0 4294967295
*Mar  1 00:19:38.731: IP-EIGRP(Default-IP-Routing-Table:100): 3.3.3.3/32 routing
 table not updated thru 192.168.24.2
*Mar  1 00:19:38.751: IP-EIGRP(Default-IP-Routing-Table:100): 3.3.3.3/32 - not i
n IP routing table
*Mar  1 00:19:38.751: IP-EIGRP(Default-IP-Routing-Table:100): Int 3.3.3.3/32 met
ric 4294967295 - 256000 4294967295

 

我们再用debug观察有stub网络情况下,若网络中其它任一节点出现故障,路由器不向stub路由器发送
查询 Ruery.

 

将R4路由器配置为stub区域

r4#
r4(config)#router eigrp 100
r4(config-router)#eigrp stub
r4#


此时我们再将R3的loop端口关闭,在R4上用debug查看

r3#
r3(config)#int loopback 0
r3(config-if)#shutdown
r3#


r4#
*Mar  1 00:22:47.479: IP-EIGRP(Default-IP-Routing-Table:100): Processing incomin
UPDATE packet
*Mar  1 00:22:47.483: IP-EIGRP(Default-IP-Routing-Table:100): Int 3.3.3.3/32 M 4
294967295 - 0 4294967295 SM 4294967295 - 0 4294967295
*Mar  1 00:22:47.499: IP-EIGRP(Default-IP-Routing-Table:100): Int 3.3.3.3/32 met
ric 4294967295 - 0 4294967295
*Mar  1 00:22:47.739: IP-EIGRP(Default-IP-Routing-Table:100): Processing incomin
g REPLY packet
*Mar  1 00:22:47.739: IP-EIGRP(Default-IP-Routing-Table:100): Int 3.3.3.3/32 M 4
294967295 - 0 4294967295 SM 4294967295 - 0 4294967295


我们可以看出两次发送的包不一样,非stub区域发送的是Processing incoming QUERY packet,
not in IP routing table
而stub区域发送的是Processing incoming UPDATE packet,
 Processing incoming REPLY packet

Notice:

   Stub区域中的路由器没有任何后门路由到其它任何节点,这些router不用来为网络中的任何地址提供透明路径。一台具有eigrp末梢邻居的路由器将不会向它的末梢发送查询。

 


现在我们将R4配置成stub receive-only :

配置前R4的路由表:

r4#
r4#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

D    192.168.12.0/24 [90/307200] via 192.168.24.2, 00:15:28, Ethernet0/3
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/409600] via 192.168.24.2, 00:15:28, Ethernet0/3
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/435200] via 192.168.24.2, 00:15:28, Ethernet0/3
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
C    192.168.24.0/24 is directly connected, Ethernet0/3
D    192.168.23.0/24 [90/307200] via 192.168.24.2, 00:15:28, Ethernet0/3
r4#

 

配置前R2的路由表:

r2#
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

C    192.168.12.0/24 is directly connected, Ethernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/409600] via 192.168.23.3, 00:19:18, Ethernet0/2
     4.0.0.0/32 is subnetted, 1 subnets
D       4.4.4.4 [90/409600] via 192.168.24.4, 00:15:54, Ethernet0/3
C    192.168.24.0/24 is directly connected, Ethernet0/3
C    192.168.23.0/24 is directly connected, Ethernet0/2
r2#

 


将R4配置为stub receive-only:

r4#
r4(config)#router eigrp 100
r4(config-router)#eigrp stub receive-only
r4#

 

此时我们再查看R4的路由表,跟之前的一样

r4#
r4#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

D    192.168.12.0/24 [90/307200] via 192.168.24.2, 00:00:33, Ethernet0/3
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/409600] via 192.168.24.2, 00:00:33, Ethernet0/3
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/435200] via 192.168.24.2, 00:00:33, Ethernet0/3
     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
C    192.168.24.0/24 is directly connected, Ethernet0/3
D    192.168.23.0/24 [90/307200] via 192.168.24.2, 00:00:33, Ethernet0/3
r4#


查看R2的路由表,跟之前的不一样,D 4.4.4.4 [90/409600] via 192.168.24.4, 00:15:54, Ethernet0/3:路由条目消失了

r2#
r2#
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

C    192.168.12.0/24 is directly connected, Ethernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/409600] via 192.168.23.3, 00:21:23, Ethernet0/2
C    192.168.24.0/24 is directly connected, Ethernet0/3
C    192.168.23.0/24 is directly connected, Ethernet0/2
r2#

 


在R4上ping R2,路径可行:
r4#
r4#
r4#ping 2.2.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/83/148 ms
r4#


在R2上pingR4,路径不可行
r2#
r2#
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 0 percent (0/5)
r2#

Notice:
  在使用receive-only选项的配置下,远端的路由器在更新消息中将不包括任何地址。可以通过在
远端路由器(图中R2的位置)添加静态路由来实现路径相通。

r2#
r2(config)#ip route 4.4.4.4 255.255.255.255 192.168.24.4
r2#

r2#
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 = 20/64/164 ms
r2#