修改EIGRP 路径cost 值,以及分析和实现等价与非等价负载均衡

一、拓扑图:
 
 

二、配置各路由器的 IP EIGRP 协议,并保证邻接关系的形成。
1 、我要达到的目的是要让 R2 192.168.14.0/24 这个网段能在 R2 R1 断开之后,形成网网络的快速收敛。因为根据 EIGRP 的次优路径进拓扑关系的形成条件是要满足 FC feasible condition =FD feasible distance >AD( 通告距离,也就是下一跳路由器到目的网段这一距离 ) 。这个条件也是为什么 EIGRP 100% 无环路的原因。现在我们看一下 R2 EIGRP 拓扑:
R2#show ip eigrp to
IP-EIGRP Topology Table for AS(100)/ID(192.168.23.2)
 
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
 
P 192.168.34.0/24, 1 successors, FD is 2172416
        via 192.168.23.3 (2172416/28160), Serial0/1
P 192.168.12.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet1/0
P 192.168.14.0/24, 1 successors, FD is 2172416
        via 192.168.12.1 (2172416/2169856), FastEthernet1/0
P 192.168.23.0/24, 1 successors, FD is 2169856
        via Connected, Serial0/1
R2#
 
 

 

 
2 、通过上面的 topology ,我们看到 R2 有一个 P passive )到 192.168.14.0 只有一条 FD 。那么我们想什么办法去满足在 R2 上形成 FD>AD 。把次优路径放进拓扑中,让 EIGRP 在另一条链路 DOWN 后形成一个快速收敛的过程。我们在 R2 上看到这么一条:
P 192.168.14.0/24, 1 successors, FD is 2172416
        via 192.168.12.1 (2172416/2169856), FastEthernet1/0
 
下面再看一下 R3:
 
R3#sho ip eigrp to
IP-EIGRP Topology Table for AS(100)/ID(192.168.34.3)
 
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
 
P 192.168.34.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet1/0
P 192.168.12.0/24, 1 successors, FD is 2172416
        via 192.168.23.2 (2172416/28160), Serial0/1
P 192.168.14.0/24, 1 successors, FD is 2172416
        via 192.168.34.4 (2172416/2169856), FastEthernet1/0
P 192.168.23.0/24, 1 successors, FD is 2169856
        via Connected, Serial0/1
R3#
 
 
R2#show ip protocols
Routing Protocol is "eigrp 100"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Outgoing routes in FastEthernet1/0 will have 1 added to metric if on list 1
  Incoming routes in FastEthernet1/0 will have 1 added to metric if on list 1
  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 2  ( 现在变成 2 )
  Redistributing: eigrp 100
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    192.168.12.0
    192.168.23.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.12.1          90      00:25:56
    192.168.23.3          90      00:25:56
  Distance: internal 90 external 170
 
 
4、  我们再看一下 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, FastEthernet1/0
D    192.168.14.0/24 [90/2684416] via 192.168.23.3, 00:29:04, Serial0/1
                     [90/2172417] via 192.168.12.1, 00:29:04, FastEthernet1/0
C    192.168.23.0/24 is directly connected, Serial0/1
D    192.168.34.0/24 [90/2172416] via 192.168.23.3, 00:29:04, Serial0/1
D    192.168.1.0/24 [90/156160] via 192.168.12.1, 00:29:04, FastEthernet1/0
R2#
  看到了有两条路径可以走了,也就是实现了EIGRP 非等价负载均衡。
 
五、分析一下非等价负载均衡包的转发情况:
1 、我先在 R2 上关上 cef 包交换
R2(config)#no ip cef
2、  我再来看一下到 192.168.14.0 路径的路由情况:
 
R2#show ip route 192.168.14.0
Routing entry for 192.168.14.0/24
  Known via "eigrp 100", distance 90, metric 2172417, type internal
  Redistributing via eigrp 100
  Last update from 192.168.23.3 on Serial0/1, 00:37:03 ago
  Routing Descriptor Blocks:
    192.168.23.3, from 192.168.23.3, 00:37:03 ago, via Serial0/1
      Route metric is 2684416, traffic share count is 97
      Total delay is 40100 microseconds, minimum bandwidth is 1544 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 2
  * 192.168.12.1, from 192.168.12.1, 00:37:03 ago, via FastEthernet1/0
      Route metric is 2172417, traffic share count is 120
      Total delay is 20100 microseconds, minimum bandwidth is 1544 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1
 
 
3、  根据上面的情况,我看到了 R2 192.168.14.0 先走 192.168.12.1 转发 120 count ,然后再会走 192.168.23.3 再转发 97 count 。正是因为一个转 120 count ,一个转 97 count, 我想也就是叫非等价的原因。
 
 
 
3 、我们看到了:
P 192.168.14.0/24, 1 successors, FD is 2172416
        via 192.168.34.4 (2172416/2169856), FastEthernet1/0
EIGRP COST 值:如果改带宽,改 K 值,这样会影响整个链路。如果只想把一条路径加进 topology 。这样我们只要 R3 192.168.14.0 FD (如果形成次路径,此段也就是 R2 192.168.14.0 AD ),让它满足小于 R2 192.168.14.0 FD 。即 FD>AD. 就会把这条链路放进拓扑中。
 
三、下面可以用 offset list 命令偏移 cost 值。把 R2 192.168.14.0 这一段改大,我们可以在 R1 的出口,或者是 R2 的进口来做。但要注意,改大 cost 值对链路是没影响的因为它还是处于 passive 状态,但如果把链路改小的话,它会有一个 active 的过程。这个在 TCP/IP 卷里面有详细说明。
 
1 、下面我在 R1 上做一个 out 方向来启用 offset :
 
R1(config)#access-list 1 permit 192.168.12.0 0.0.0.255( 通告 192.168.14.0 R2 时调用这 cost )
R1(config)#router eigrp 100
R1(config-router)#offset-list 1 out 1 fastEthernet1/0  ( 我让它在 R1 F1/0 这个出口上调用上 access-list 1)
 
2 OK, 现在 R2 192.168.14.0/24 FD 偏移了 1 ,变成了 2172417
 
R2#show ip eigrp topology
IP-EIGRP Topology Table for AS(100)/ID(192.168.23.2)
 
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
 
P 192.168.34.0/24, 1 successors, FD is 2172416
        via 192.168.23.3 (2172416/28160), Serial0/1
P 192.168.12.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet1/0
P 192.168.14.0/24, 1 successors, FD is 2172417
        via 192.168.12.1 (2172417/2169857), FastEthernet1/0
        via 192.168.23.3 (2684416/2172416), Serial0/1 ( 这个值就是 R2 192.168.14.0 AD)
P 192.168.1.0/24, 1 successors, FD is 156160
        via 192.168.12.1 (156160/128256), FastEthernet1/0
P 192.168.23.0/24, 1 successors, FD is 2169856
        via Connected, Serial0/1
 
四、在 R2 上实现非等价负载均衡:
1 、通过偏移 cost 值之后,下面我们再看一下 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, FastEthernet1/0
D    192.168.14.0/24 [90/2172417] via 192.168.12.1, 00:10:52, FastEthernet1/0
C    192.168.23.0/24 is directly connected, Serial0/1
D    192.168.34.0/24 [90/2172416] via 192.168.23.3, 00:10:52, Serial0/1
D    192.168.1.0/24 [90/156160] via 192.168.12.1, 00:10:53, FastEthernet1/0
 
2、通过上面的显示情况, R2 192.168.14.0 这个网段是走 R2 这条路径过去,因为偏移只是把次路径放入 topology ,并没有放入路由表,那么我现在想让它放入路由表,这样可以实现通过两条路径到 192.168.14.0 。有效的实现了非等价负载均衡。但是必须要让它满足一个条件,就是 R2 successor(FD) ×variance 值≥Feasible Successor,缺省情况下variance 等于1,这样就是等价均衡,我只要把R2上面FD乘以2就能形成非等价负载均衡:
 
R2(config)#router eigrp 100
R2(config-router)#variance 2
 
3、  通过上面的修改,我们现在再看一下 R2 variance :

你可能感兴趣的:(职场,cost,休闲,EIGRP,非等价负载均衡)