R1から、R5のloopback 200.0.0.1へアクセスしたい。
R2とR3で、ospfとeigrpの相互redistributeをすればよい。
<R2>
router eigrp 1
redistribute ospf 1 metric 1544 2000 255 1 1500
network 10.1.0.0 0.0.0.255
network 100.0.0.0 0.0.0.255
auto-summary
!
router ospf 1
log-adjacency-changes
redistribute eigrp 1 subnets
<R3>
router eigrp 1
redistribute ospf 1 metric 1000000 1 255 1 1500
network 10.1.0.0 0.0.0.255
auto-summary
!
router ospf 1
log-adjacency-changes
redistribute eigrp 1 subnets
network 30.0.0.0 0.0.0.255 area 0
!
!
R1#ping 200.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/78/92 ms
R1#
pingは通るようになった。しかし、tracerouteしてみると、
低速なシリアルI/Fを経由してしまっている。
R1#traceroute 200.0.0.1
Type escape sequence to abort.
Tracing the route to 200.0.0.1
1 100.0.0.254 36 msec 60 msec 64 msec
2 20.0.0.2 60 msec 64 msec 64 msec
3 40.0.0.2 120 msec 92 msec 92 msec
R1#
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
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.0.0.0/24 is directly connected, FastEthernet0/0
D 100.0.0.0/8 is a summary, 00:00:10, Null0
200.0.0.0/32 is subnetted, 1 subnets
O 200.0.0.1 [110/66] via 20.0.0.2, 00:00:12, Serial3/0
20.0.0.0/24 is subnetted, 1 subnets
C 20.0.0.0 is directly connected, Serial3/0
40.0.0.0/24 is subnetted, 1 subnets
O 40.0.0.0 [110/65] via 20.0.0.2, 00:00:12, Serial3/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 10.0.0.0/8 is a summary, 00:00:10, Null0
C 10.1.0.0/24 is directly connected, GigabitEthernet1/0
30.0.0.0/24 is subnetted, 1 subnets
O 30.0.0.0 [110/65] via 20.0.0.2, 00:00:13, Serial3/0
R2はOSPFとEIGRPを両方動作させているいわゆるASBRであり、二つのプロトコルから
経路を学習している。
そして、200.0.0.1への経路はOSPFで学習した、next hopが20.0.0.2の経路である。
EIGRPで学習した経路情報を見てみる。
R2#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(100.0.0.254)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 10.0.0.0/8, 1 successors, FD is 2816
via Summary (2816/0), Null0
P 10.1.0.0/24, 1 successors, FD is 2816
via Connected, GigabitEthernet1/0
P 20.0.0.0/24, 1 successors, FD is 2169856
via Redistributed (2169856/0)
via 10.1.0.2 (3072/2816), GigabitEthernet1/0
P 30.0.0.0/24, 1 successors, FD is 2169856
via Redistributed (2169856/0)
via 10.1.0.2 (3072/2816), GigabitEthernet1/0
P 40.0.0.0/24, 1 successors, FD is 2169856
via Redistributed (2169856/0)
via 10.1.0.2 (3072/2816), GigabitEthernet1/0
P 100.0.0.0/8, 1 successors, FD is 28160
via Summary (28160/0), Null0
P 100.0.0.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
via 10.1.0.2 (3072/2816), GigabitEthernet1/0
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 200.0.0.1/32, 1 successors, FD is 2169856
via Redistributed (2169856/0)
via 10.1.0.2 (3072/2816), GigabitEthernet1/0
R2#
EIGRPでも200.0.0.1/32への経路は学習されているが、
ルーティングテーブルに載らない。
これは、ルーティングテーブルに載せる経路を選択するときに最初に比較されるAdministrative Distanceが、
OSPFの経路は110、EIGRPの外部経路は170で、
OSPFの経路が採用されるからである。
そこで、EIGRPの外部経路のdistance値を、110より小さい値に変更する。
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router eigrp 1
R2(config-router)#distance ?
<1-255> Administrative distance
eigrp IP-EIGRP distance
R2(config-router)#distance eigrp ?
<1-255> Distance for internal routes
R2(config-router)#distance eigrp 90 ?
<1-255> Distance for external routes
R2(config-router)#distance eigrp 90 105
R2(config-router)#end
R2#
*Feb 11 11:25:52.463: %SYS-5-CONFIG_I: Configured from console by console
R2#
R2#
*Feb 11 11:26:01.431: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.0.2 (GigabitEthernet1/0) is down: route configuration changed
*Feb 11 11:26:01.443: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 100.0.0.1 (FastEthernet0/0) is down: route configuration changed
R2#
*Feb 11 11:26:04.091: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 100.0.0.1 (FastEthernet0/0) is up: new adjacency
*Feb 11 11:26:04.747: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.0.2 (GigabitEthernet1/0) is up: new adjacency
R2#
すると、EIGRPの二つのneighborが一度ダウンして再度UPする。
変更後のR2のルーティングテーブルを見てみる。
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
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.0.0.0/24 is directly connected, FastEthernet0/0
D 100.0.0.0/8 is a summary, 00:14:28, Null0
200.0.0.0/32 is subnetted, 1 subnets
D EX 200.0.0.1 [105/3072] via 10.1.0.2, 00:00:13, GigabitEthernet1/0
20.0.0.0/24 is subnetted, 1 subnets
C 20.0.0.0 is directly connected, Serial3/0
40.0.0.0/24 is subnetted, 1 subnets
D EX 40.0.0.0 [105/3072] via 10.1.0.2, 00:00:13, GigabitEthernet1/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 10.0.0.0/8 is a summary, 00:00:13, Null0
C 10.1.0.0/24 is directly connected, GigabitEthernet1/0
30.0.0.0/24 is subnetted, 1 subnets
D EX 30.0.0.0 [105/3072] via 10.1.0.2, 00:00:13, GigabitEthernet1/0
R2#
R2#
200.0.0.1への経路として、D EXつまりEIGRPで学習した外部経路が採用されており、
そのnext hopは 10.1.0.2である。
R1からのtracerouteの結果も変わった。
R1#traceroute 200.0.0.1
Type escape sequence to abort.
Tracing the route to 200.0.0.1
1 100.0.0.254 44 msec 64 msec 64 msec
2 10.1.0.2 92 msec 92 msec 64 msec
3 30.0.0.2 64 msec 124 msec 16 msec
4 40.0.0.2 116 msec 44 msec 40 msec
R1#
では、EIGRPのdistanceを変更せずに、OSPFのdistanceを大きくしても、
同じことができるのではないか?
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#distance ?
<1-255> Administrative distance
ospf OSPF distance
R2(config-router)#distance ospf ?
external External type 5 and type 7 routes
inter-area Inter-area routes
intra-area Intra-area routes
R2(config-router)#distance ospf intra-area 200
R2(config-router)#end
R2#
*Feb 11 11:39:58.407: %SYS-5-CONFIG_I: Configured from console by console
R2#
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
100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 100.0.0.0/24 is directly connected, FastEthernet0/0
D 100.0.0.0/8 is a summary, 00:28:18, Null0
200.0.0.0/32 is subnetted, 1 subnets
D EX 200.0.0.1 [170/3072] via 10.1.0.2, 00:00:11, GigabitEthernet1/0
20.0.0.0/24 is subnetted, 1 subnets
C 20.0.0.0 is directly connected, Serial3/0
40.0.0.0/24 is subnetted, 1 subnets
D EX 40.0.0.0 [170/3072] via 10.1.0.2, 00:00:11, GigabitEthernet1/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 10.0.0.0/8 is a summary, 00:01:01, Null0
C 10.1.0.0/24 is directly connected, GigabitEthernet1/0
30.0.0.0/24 is subnetted, 1 subnets
できる・・・。
OSPFのデフォルトのAD値は110で、外部も内部も同じであるが、
変更は external, inter-area, intra-area それぞれでおこなえる・・・というのは
今初めて知った・・・・。