EIGRP:Enhanced Interior Gateway Routing Protocol(增强网关内部路由线路协议)是Cisco的私有路由协议,它综合了距离矢量和链路状态2者的优点。

 

  基本配置

 

1

 

 

  基本配置如下(拓扑如上图):

R1:

interface Loopback0
ip address 1.1.1.1 255.255.255.0

interface Serial1/1
ip address 12.1.1.1 255.255.255.0

router eigrp 1
 network 1.1.1.1 0.0.0.0
 network 12.1.1.1 0.0.0.0
no auto-summary

 

R2:

interface Loopback0
ip address 2.2.2.2 255.255.255.0

interface Serial1/0
ip address 12.1.1.2 255.255.255.0

router eigrp 1
network
2.2.2.2 0.0.0.0
 network 12.1.1.2 0.0.0.0
no auto-summary

 

  命令中 no auto-summary 用来关闭eigrp的自动汇总,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

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/2297856] via 12.1.1.2, 00:05:44, Serial1/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/1

 

  图中D来头的路由条目就是EIGRP学习到的路由条目。我们再来看看eigrp的接口信息

 

R1#show ip protocols
Routing Protocol is "eigrp 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 1
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    1.1.1.1/32
    12.1.1.1/32
  Routing Information Sources:
    Gateway         Distance      Last Update
    12.1.1.2              90      00:10:48
  Distance: internal 90 external 170

 

  我们可以看到EIGRP 的 weight 默认K1和K3置一,也就是说默认用带宽和延迟来计算EIGRP的metric。EIGRP的默认跳数数是100 ,我们可以在路由配置模式下利用metric maximum-hops 命令将跳数进行更改,最大支持255。上面的输出还可以看到EIGRP的hold时间默认是240秒,我们可以在接口配置模式下用 ip hold-time eigrp 1  来修改hold时间,利用 ip hello-interval eigrp 1 来修改 hello-interval时间,EIGRP默认支持四条链路的不等代价的负载均衡(Maximum path: 4)我们可以用命令 maximum-paths ,最大支持16条链路的非等价负载均衡。最后就是EIGRP的管理距离,内部默认是90,外部默认是170,在路由配置模式下可以利用distance 命令进行修改。

  我们来查看一下EIGRP邻居建立好了以后的发包情况

 

R1#debug eigrp packets
EIGRP Packets debugging is on
    (UPDATE, REQUEST, QUERY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB, SIAQUERY, SIAREPLY)
R1#
*Mar  1 02:09:45.251: EIGRP: Received HELLO on Serial1/1 nbr 12.1.1.2
*Mar  1 02:09:45.255:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 02:09:46.019: EIGRP: Sending HELLO on Serial1/1
*Mar  1 02:09:46.019:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
R1#
*Mar  1 02:09:47.299: EIGRP: Sending HELLO on Loopback0
*Mar  1 02:09:47.303:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
*Mar  1 02:09:47.311: EIGRP: Received HELLO on Loopback0 nbr 1.1.1.1
*Mar  1 02:09:47.315:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0
*Mar  1 02:09:47.315: EIGRP: Packet from ourselves ignored
R1#
*Mar  1 02:09:49.859: EIGRP: Received HELLO on Serial1/1 nbr 12.1.1.2
*Mar  1 02:09:49.863:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 02:09:50.799: EIGRP: Sending HELLO on Serial1/1
*Mar  1 02:09:50.799:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
R1#
*Mar  1 02:09:51.991: EIGRP: Sending HELLO on Loopback0
*Mar  1 02:09:51.991:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
*Mar  1 02:09:52.003: EIGRP: Received HELLO on Loopback0 nbr 1.1.1.1
*Mar  1 02:09:52.007:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0
*Mar  1 02:09:52.007: EIGRP: Packet from ourselves ignored
R1#
*Mar  1 02:09:54.827: EIGRP: Received HELLO on Serial1/1 nbr 12.1.1.2
*Mar  1 02:09:54.831:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 02:09:55.763: EIGRP: Sending HELLO on Serial1/1
*Mar  1 02:09:55.763:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0

*Mar  1 02:09:56.479: EIGRP: Sending HELLO on Loopback0
*Mar  1 02:09:56.483:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
*Mar  1 02:09:56.491: EIGRP: Received HELLO on Loopback0 nbr 1.1.1.1
*Mar  1 02:09:56.495:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0
*Mar  1 02:09:56.495: EIGRP: Packet from ourselves ignored

 

  上面我们可以看出EIGRP的HELLO包在串口是每隔5秒发一次的,而且邻居建立好以后是以单播的形式进行更新。我们可以在路由配置模式下利用 passive-interface 命令禁止某接口进行收发EIGRP报文。

  我们将R1的S1/1口shutdown掉,然后重新起一下接口,看看EIGRP的邻居建立。

 

*Mar  1 02:23:06.111: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Mar  1 02:23:06.399: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
*Mar  1 02:23:06.407: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 12.1.1.2 (Serial1/1) is up: new adjacency
R1#
*Mar  1 02:23:06.419: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:23:06.431: IP: s=12.1.1.1 (local), d=12.1.1.2 (Serial1/1), len 40, sending
R1#
*Mar  1 02:23:07.115: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R1#
*Mar  1 02:23:08.435: IP: s=12.1.1.1 (local), d=12.1.1.2 (Serial1/1), len 40, sending
R1#
*Mar  1 02:23:10.787: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:23:10.831: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
*Mar  1 02:23:10.911: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
*Mar  1 02:23:10.939: IP: tableid=0, s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), routed via RIB
*Mar  1 02:23:10.939: IP: s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), len 40, rcvd 3
*Mar  1 02:23:11.439: IP: s=12.1.1.1 (local), d=12.1.1.2 (Serial1/1), len 40, sending
*Mar  1 02:23:11.535: IP: tableid=0, s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), routed via RIB
*Mar  1 02:23:11.539: IP: s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), len 68, rcvd 3
*Mar  1 02:23:11.555: IP: s=12.1.1.1 (local), d=12.1.1.2 (Serial1/1), len 68, sending
*Mar  1 02:23:11.599: IP: tableid=0, s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), routed via RIB
*Mar  1 02:23:11.603: IP: s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), l
R1#en 68, rcvd 3
*Mar  1 02:23:11.615: IP: s=12.1.1.1 (local), d=12.1.1.2 (Serial1/1), len 68, sending
*Mar  1 02:23:11.935: IP: s=12.1.1.1 (local), d=12.1.1.2 (Serial1/1), len 68, sending
*Mar  1 02:23:11.995: IP: tableid=0, s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), routed via RIB
*Mar  1 02:23:11.999: IP: s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), len 40, rcvd 3
R1#
*Mar  1 02:23:15.263: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:23:15.575: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
R1#
*Mar  1 02:23:19.847: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:23:19.895: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
R1#
*Mar  1 02:23:24.423: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:23:24.435: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
R1#
*Mar  1 02:23:28.975: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
*Mar  1 02:23:29.047: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
R1#
*Mar  1 02:23:33.459: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:23:33.675: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2

 

 

  从上面可以看到EIGRP是以224.0.0.10这个组播地址来发送HELLO包,协商建立邻居的,我没这时再在R2在起个环回口lo1,并宣告,看看EIGRP的学习情况。

 

配置如下:

R2:

interface Loopback0
ip address 2.2.2.2 255.255.255.0

router eigrp 1
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
 network 22.22.22.22 0.0.0.0
no auto-summary

 

debug 信息如下:

 

*Mar  1 02:29:33.799: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:29:34.115: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
R1#
*Mar  1 02:29:38.307: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:29:38.495: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
R1#
*Mar  1 02:29:42.915: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:29:43.207: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
R1#
*Mar  1 02:29:45.003: IP: tableid=0, s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), routed via RIB
*Mar  1 02:29:45.007: IP: s=12.1.1.2 (Serial1/1), d=12.1.1.1 (Serial1/1), len 68, rcvd 3
*Mar  1 02:29:45.019: IP: s=12.1.1.1 (local), d=12.1.1.2 (Serial1/1), len 40, sending
R1#
*Mar  1 02:29:47.879: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast
*Mar  1 02:29:48.147: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
R1#
*Mar  1 02:29:52.783: IP: s=12.1.1.2 (Serial1/1), d=224.0.0.10, len 60, rcvd 2
*Mar  1 02:29:52.851: IP: s=12.1.1.1 (local), d=224.0.0.10 (Serial1/1), len 60, sending broad/multicast

 

中间的IP报文可以看到,路由表的交互是利用对端IP收发的。

 

   EIGRP的路由汇总

 

 

 

 

  EIGRP的路由汇总可以在接口下完成的,我们首先在R1上起3个换回口lo1-lo3,ip地址是192.168.1.0 /24  - 192.168.3.0 /24 ,并通告到EIGRP中。

配置如下:

 

R1:

 

interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Loopback1
ip address 192.168.1.1 255.255.255.0
!
interface Loopback2
ip address 192.168.2.1 255.255.255.0
!        
interface Loopback3
ip address 192.168.3.1 255.255.255.0

 

router eigrp 1
passive-interface Loopback0
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
network 192.168.0.0 0.0.255.255
no auto-summary

 

  没做汇总之前我们先来看看R2的路由表:

 

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 12.1.1.1, 00:14:41, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     22.0.0.0/24 is subnetted, 1 subnets
C       22.22.22.0 is directly connected, Loopback1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D    192.168.1.0/24 [90/2297856] via 12.1.1.1, 00:00:04, Serial1/0
D    192.168.2.0/24 [90/2297856] via 12.1.1.1, 00:00:04, Serial1/0
D    192.168.3.0/24 [90/2297856] via 12.1.1.1, 00:00:04, Serial1/0

 

  接下来我们在R1的S1/1口用命令:ip summary-address eigrp 1 192.168.1.1 255.255.0.0 

  然后我们再来看看R2的路由表:

 

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 12.1.1.1, 00:17:45, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     22.0.0.0/24 is subnetted, 1 subnets
C       22.22.22.0 is directly connected, Loopback1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D    192.168.0.0/16 [90/2297856] via 12.1.1.1, 00:00:04, Serial1/0

 

  我们可以看到192.168.1.0 /24 -192.168.3.0 /24网段已经被汇总成192.168.0.0 /16 的网段。

 

 

发布缺省路由

 

  ① D* 类型缺省(指定网段)

 

配置如下:

 

router eigrp 1
passive-interface Loopback0
passive-interface Loopback1
passive-interface Loopback2
passive-interface Loopback3
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
 network 192.168.0.0 0.0.255.255
no auto-summary
!
ip default-network 192.168.0.0
ip route 192.168.0.0 255.255.0.0 Loopback0

 

 

在R2上查看路由表:

 

R2#sho 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 192.168.0.0

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 12.1.1.1, 00:02:04, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D    192.168.1.0/24 [90/2297856] via 12.1.1.1, 00:00:22, Serial1/0
D    192.168.2.0/24 [90/2297856] via 12.1.1.1, 00:00:22, Serial1/0
D    192.168.3.0/24 [90/2297856] via 12.1.1.1, 00:00:22, Serial1/0
D*   192.168.0.0/16 [90/2297856] via 12.1.1.1, 00:00:22, Serial1/0

 

 

  ② D* 类型缺省(利用汇总实现全局缺省)

 

配置如下:

 

R1:

interface Serial1/1
ip address 12.1.1.1 255.255.255.0
 
ip summary-address eigrp 1 0.0.0.0 0.0.0.0 5

ip route 0.0.0.0 0.0.0.0 Loopback0

 

此时我们再来看看R2的路由表:

 

R2#sho 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

     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D*   0.0.0.0/0 [90/2297856] via 12.1.1.1, 00:04:50, Serial1/0

 

  其实这个就是利用汇总的原理,由R1向R2发一条缺省路由。 

 

  ③ D EX 类型缺省(外部汇总)

 

  R1的配置:

interface Serial1/1
ip address 12.1.1.1 255.255.255.0

router eigrp 1
 redistribute static
passive-interface Loopback0
passive-interface Loopback1
passive-interface Loopback2
passive-interface Loopback3
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
no auto-summary
!
ip route 192.168.0.0 255.255.0.0 Loopback0

 

  R2上看路由表:

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 12.1.1.1, 00:05:24, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D EX 192.168.0.0/16 [170/2297856] via 12.1.1.1, 00:02:17, Serial1/0

 

 ④ D*EX 类型缺省

 

R1的配置:

 

interface Serial1/1
ip address 12.1.1.1 255.255.255.0

router eigrp 1
 redistribute static
passive-interface Loopback0
passive-interface Loopback1
passive-interface Loopback2
passive-interface Loopback3
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
no auto-summary

ip default-network 192.168.0.0
ip route 192.168.0.0 255.255.0.0 Loopback0

 

  R2上看路由表:

 

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 12.1.1.1, 00:06:45, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D*EX 192.168.0.0/16 [170/2297856] via 12.1.1.1, 00:00:04, Serial1/0

 

 

EIGRP负载均衡

 

 

   ① 等开销负载均衡

 

      A  修改metric 实现等开销负载均衡:

 

  EIGRP默认利用带宽和延迟来计算一条路径的metric值,所以我们可以通过修改带宽和延迟来达到等开销负载均衡的目的。我们在R1和R2新增一条以太网链路,拓扑如下:

 

 

2

 

 

我们首先宣告R1和R2以太网的地址,并在R1的S1/1和F0/0对192.168.0.0网段进行汇总:

R1:

 

interface FastEthernet0/0
ip address 123.1.1.1 255.255.255.0
ip summary-address eigrp 1 192.168.0.0 255.255.0.0 5

router eigrp 1
passive-interface Loopback0
passive-interface Loopback1
passive-interface Loopback2
passive-interface Loopback3
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
network 123.1.1.1 0.0.0.0
network 192.168.0.0 0.0.255.255

no auto-summary

 

R2:

 

interface FastEthernet0/0
ip address 123.1.1.2 255.255.255.0

 

router eigrp 1
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 123.1.1.2 0.0.0.0
no auto-summary

 

我们再来看看R2的路由表:

 

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/156160] via 123.1.1.1, 00:05:10, FastEthernet0/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D    192.168.0.0/16 [90/156160] via 123.1.1.1, 00:03:27, FastEthernet0/0

 

  R2去R1的路由都已经走以太网了,我们来对比一下R2的接口信息:

 

R2#sho interfaces s1/0
Serial1/0 is up, line protocol is up
  Hardware is M4T
  Internet address is 12.1.1.2/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, crc 16, loopback not set
  Keepalive set (10 sec)
  Restart-Delay is 0 secs
  Last input 00:00:01, output 00:00:01, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations  0/1/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     1369 packets input, 89431 bytes, 0 no buffer
     Received 452 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     1373 packets output, 89297 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 output buffer failures, 0 output buffers swapped out
     2 carrier transitions     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up

 

 

R2#sho interfaces f0/0
FastEthernet0/0 is up, line protocol is up
  Hardware is AmdFE, address is cc01.0d08.0000 (bia cc01.0d08.0000)
  Internet address is 123.1.1.2/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s, 100BaseTX/FX
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:01, output 00:00:02, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     188 packets input, 16816 bytes
     Received 167 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog
     0 input packets with dribble condition detected
     230 packets output, 20048 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out

 

  EIGRP默认metric的计算公式是 256*(10^7/(BW*K1)+DLY*K3/10),所以带宽越大越,metric也就越小,延迟越小,metric也就越小,metric也就越小,路由条目也就越优先。

  我们可以通过修改带宽和延迟来达到等开销负载均衡的目的,配置如下:

 

R2:

 

interface FastEthernet0/0
 bandwidth 1544
ip address 123.1.1.2 255.255.255.0
 delay 2000

 

注意delay 命令值的单位是10 usec,我们来看看R2路由表:

 

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 123.1.1.1, 00:00:16, FastEthernet0/0
                [90/2297856] via 12.1.1.1, 00:00:16, Serial1/0

     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/0
D    192.168.0.0/16 [90/2297856] via 123.1.1.1, 00:00:16, FastEthernet0/0
                    [90/2297856] via 12.1.1.1, 00:00:16, Serial1/0

  已经走等开负载了,要实现双向负载就必须再R1和R2上都进行相同的操作。

 

 

B  利用 offset-list 实现等开销负载均衡:

 

offset-list 是将进来或着出去路由条目的metric进行增大,已达到metric相同的目的。我们在R1来看看两条路径的FD差多少,命令是 show ip eigrp topology 如下:

R1#sho ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(192.168.3.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 1.1.1.0/24, 1 successors, FD is 128256
        via Connected, Loopback0
P 2.2.2.0/24, 1 successors, FD is 156160
        via 123.1.1.2 (156160/128256), FastEthernet0/0
        via 12.1.1.2 (2297856/128256), Serial1/1

P 12.1.1.0/24, 1 successors, FD is 2169856
        via Connected, Serial1/1
P 192.168.0.0/16, 1 successors, FD is 128256
        via Summary (128256/0), Null0
P 192.168.1.0/24, 1 successors, FD is 128256
        via Connected, Loopback1
P 192.168.2.0/24, 1 successors, FD is 128256
        via Connected, Loopback2
P 192.168.3.0/24, 1 successors, FD is 128256
        via Connected, Loopback3
P 123.1.1.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet0/0

 

  利用 2297856 - 156160 = 2141696 ,也就是说我们要将F0/0的2.2.2.2 这条路由偏移 2141696, 配置如下:

R1:

router eigrp 1
passive-interface Loopback0
passive-interface Loopback1
passive-interface Loopback2
passive-interface Loopback3
 offset-list 1 in 2141696 FastEthernet0/0
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
network 123.1.1.1 0.0.0.0
network 192.168.0.0 0.0.255.255
no auto-summary
!
access-list 1 permit 2.2.2.0 0.0.0.255

 

我们来看看R1的路由表:

 

R1#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/2297856] via 123.1.1.2, 00:01:53, FastEthernet0/0
                [90/2297856] via 12.1.1.2, 00:01:53, Serial1/1

     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/1
C    192.168.1.0/24 is directly connected, Loopback1
C    192.168.2.0/24 is directly connected, Loopback2
C    192.168.3.0/24 is directly connected, Loopback3
D    192.168.0.0/16 is a summary, 00:06:57, Null0

 

  已经走负载了,metric都已经变成 2297856 了。

 

 

   ② 非等开销负载均衡

 

  利用 variance 进行非等开销负载均衡,原理是 successors’s FD * variance > = feasible successor’s FD,我们首先清除掉R1的等开销负载配置,然后看看R1上的拓扑信息如下:

 

R1#sho ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(192.168.3.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 1.1.1.0/24, 1 successors, FD is 128256
        via Connected, Loopback0
P 2.2.2.0/24, 1 successors, FD is 156160
        via 123.1.1.2 (156160/128256), FastEthernet0/0
        via 12.1.1.2 (2297856/128256), Serial1/1
P 12.1.1.0/24, 1 successors, FD is 2169856
        via Connected, Serial1/1
P 192.168.0.0/16, 1 successors, FD is 128256
        via Summary (128256/0), Null0
P 192.168.1.0/24, 1 successors, FD is 128256
        via Connected, Loopback1
P 192.168.2.0/24, 1 successors, FD is 128256
        via Connected, Loopback2
P 192.168.3.0/24, 1 successors, FD is 128256
        via Connected, Loopback3
P 123.1.1.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet0/0

 

上面可以看到successors的FD是156160,feasible successor的FD是 2297856 ,用  2297856 /156160 ≈ 15 所以 variance 15 就可以了,配置如下:

 

R1:

 

router eigrp 1
 variance 15
passive-interface Loopback0
passive-interface Loopback1
passive-interface Loopback2
passive-interface Loopback3
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
network 123.1.1.1 0.0.0.0
network 192.168.0.0 0.0.255.255
no auto-summary

 

我们来看看R1的路由表:

 

R1#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/156160] via 123.1.1.2, 00:02:04, FastEthernet0/0
                [90/2297856] via 12.1.1.2, 00:02:04, Serial1/1

     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial1/1
C    192.168.1.0/24 is directly connected, Loopback1
C    192.168.2.0/24 is directly connected, Loopback2
C    192.168.3.0/24 is directly connected, Loopback3
D    192.168.0.0/16 is a summary, 00:02:04, Null0

 

非等开销负载均衡已经实现了,这里要注意的是,必须有一条可行后继路由才可以实现,如果没有的话,可以用 show ip eigrp topology detail-links 找到合适的路由,再利用offset-list 使其满足 AD<FD ,然后在进行上面的才做。

 

 

EIGRP Over Frame-Relay (hub-and-spoke类型)

 

  拓扑如下:

   3

 

 

基本配置如下:

 

R1:

interface Serial1/2
ip address 123.1.1.1 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
frame-relay map ip 123.1.1.3 103 broadcast
frame-relay map ip 123.1.1.2 102 broadcast
no frame-relay inverse-arp

router eigrp 1
passive-interface Loopback0
network 1.1.1.1 0.0.0.0
network 123.1.1.1 0.0.0.0
no auto-summary

 

R2:

interface Serial1/2
ip address 123.1.1.2 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
frame-relay map ip 123.1.1.1 201 broadcast
no frame-relay inverse-arp

router eigrp 1
network 2.2.2.2 0.0.0.0
network 123.1.1.2 0.0.0.0
no auto-summary

 

R3:

interface Serial1/2
ip address 123.1.1.3 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
frame-relay map ip 123.1.1.1 301 broadcast
no frame-relay inverse-arp

router eigrp 1
network 3.3.3.3 0.0.0.0
network 123.1.1.3 0.0.0.0
no auto-summary

 

 ① 水平分割的问题

 

通过上面的命令我们可以看到一下路由表:

 

R1#sho ip rou
R1#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/2297856] via 123.1.1.2, 00:03:59, Serial1/2
     3.0.0.0/24 is subnetted, 1 subnets
D       3.3.3.0 [90/2297856] via 123.1.1.3, 00:03:07, Serial1/2

     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, Serial1/2

 

 

R2#sho ip rou
R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 123.1.1.1, 00:06:05, Serial1/2
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, Serial1/2

 

R3#sho ip rou
R3#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 123.1.1.1, 00:05:24, Serial1/2
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, Serial1/2

 

  如上路由表我们会发现,Hub端有去spoke端的路由,但是spoke只有Hub的路由,没有去spoke的路由,这是因为EIGRP默认开启了水平分割功能,我们将其关闭就可以了,配置如下:

 

 R1:

 

interface Serial1/2
ip address 123.1.1.1 255.255.255.0
encapsulation frame-relay
no ip split-horizon eigrp 1
serial restart-delay 0
frame-relay map ip 123.1.1.3 103 broadcast
frame-relay map ip 123.1.1.2 102 broadcast
no frame-relay inverse-arp

 

  现在我们来看看R2和R3的路由表:

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 123.1.1.1, 00:11:51, Serial1/2
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     3.0.0.0/24 is subnetted, 1 subnets
D       3.3.3.0 [90/2809856] via 123.1.1.1, 00:01:52, Serial1/2
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, Serial1/2

 

 

R3#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 123.1.1.1, 00:11:21, Serial1/2
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/2809856] via 123.1.1.1, 00:02:13, Serial1/2

     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, Serial1/2

 

如上已经可以学到对端的路由了。

 

 

② next-hop-self 的问题

 

在hub-and-spoke 网络类型中,如果我们在Hub关闭了EIGRP的 next-hop-self 的功能,上面的配置将不能实现全网互通,我们来测试一下,R1接口配置改成如下:

 

interface Serial1/2
ip address 123.1.1.1 255.255.255.0
 no ip next-hop-self eigrp 1
encapsulation frame-relay
no ip split-horizon eigrp 1
serial restart-delay 0
frame-relay map ip 123.1.1.3 103 broadcast
frame-relay map ip 123.1.1.2 102 broadcast
no frame-relay inverse-arp

 

  我们再来看看R2 和 R3的路由表:

 

R2#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 123.1.1.1, 00:01:08, Serial1/2
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     3.0.0.0/24 is subnetted, 1 subnets
D       3.3.3.0 [90/2809856] via 123.1.1.3, 00:00:11, Serial1/2
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, Serial1/2

 

R3#sho 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

     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/2297856] via 123.1.1.1, 00:01:40, Serial1/2
     2.0.0.0/24 is subnetted, 1 subnets
D       2.2.2.0 [90/2809856] via 123.1.1.2, 00:01:40, Serial1/2
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
     123.0.0.0/24 is subnetted, 1 subnets
C       123.1.1.0 is directly connected, Serial1/2

 

  这时我们会发下,spoke端指向其他spoke 端的路由已经变成发送方本身了,现在因为二层没有可用PVC,所以R2和R3之间的换回口是不能互通的,除非做MAP或者打开next-hop-self功能。

 

EIGRP Stub 区

 

  命令如下:

 

R1(config-router)#eigrp stub ?
  connected      Do advertise connected routes
  leak-map       Allow dynamic prefixes based on the leak-map
  receive-only   Set IP-EIGRP as receive only neighbor
  redistributed  Do advertise redistributed routes
  static         Do advertise static routes
  summary        Do advertise summary routes

6种不同的模式。

 

EIGRP认证

 

 

  EIGRP的认证和RIP的很相似,利用上面帧中继的拓扑,我们来实现R1和R2之间的认证,配置如下:

 

R1:

 

key chain ccie
key 1
  key-string cisco

 

interface Serial1/2
ip address 123.1.1.1 255.255.255.0
ip authentication mode eigrp 1 md5
ip authentication key-chain eigrp 1 ccie

encapsulation frame-relay
no ip split-horizon eigrp 1
serial restart-delay 0
frame-relay map ip 123.1.1.3 103 broadcast
frame-relay map ip 123.1.1.2 102 broadcast
no frame-relay inverse-arp

 

R2:

 

key chain ccnp
key 1
  key-string cisco

 

interface Serial1/2
ip address 123.1.1.2 255.255.255.0
ip authentication mode eigrp 1 md5
ip authentication key-chain eigrp 1 ccnp
encapsulation frame-relay
serial restart-delay 0
frame-relay map ip 123.1.1.1 201 broadcast
no frame-relay inverse-arp

 

R3:

 

interface Serial1/2
ip address 123.1.1.3 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
frame-relay map ip 123.1.1.1 301 broadcast
no frame-relay inverse-arp

 

 

  此时我们查看一下EIGRP的数据包,如下:

 

R1#debug eigrp packets
EIGRP Packets debugging is on
    (UPDATE, REQUEST, QUERY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB, SIAQUERY, SIAREPLY)
R1#
*Mar  1 00:35:50.735: EIGRP: Serial1/2: ignored packet from 123.1.1.3, opcode = 5 (missing authentication)
*Mar  1 00:36:04.683: EIGRP: received packet with MD5 authentication, key id = 1
*Mar  1 00:36:04.687: EIGRP: Received HELLO on Serial1/2 nbr 123.1.1.2

*Mar  1 00:36:04.687:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 00:36:12.339: EIGRP: Sending HELLO on Serial1/2
*Mar  1 00:36:12.343:   AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
*Mar  1 00:36:46.363: EIGRP: Serial1/2: ignored packet from 123.1.1.3, opcode = 5 (missing authentication)

 

  上面我们可以看到R1和R2之间可以正常发包,而R1和R3之间则提示认证丢失。