このブログを検索

2015/02/11

OSPFの集約


R1のルーティングテーブル

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/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA    100.0.2.33/32 [110/3] via 100.0.1.2, 00:09:07, GigabitEthernet1/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
O IA    100.0.2.0/30 [110/2] via 100.0.1.2, 00:32:16, GigabitEthernet1/0
O IA    100.0.2.22/32 [110/2] via 100.0.1.2, 00:01:59, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/24 is subnetted, 5 subnets
D EX    10.0.2.0 [170/51456] via 20.0.1.1, 00:17:56, GigabitEthernet2/0
D EX    10.0.3.0 [170/51456] via 20.0.1.1, 00:17:56, GigabitEthernet2/0
D EX    10.0.1.0 [170/51456] via 20.0.1.1, 00:17:56, GigabitEthernet2/0
D EX    10.0.4.0 [170/51456] via 20.0.1.1, 00:17:29, GigabitEthernet2/0
D EX    10.0.5.0 [170/51456] via 20.0.1.1, 00:17:25, GigabitEthernet2/0
R1#


R1はEIGRP/OSPF間のASBRで、OSPFエリア1に所属しているので、
OSPFのエリア外経路とEIGRPの経路を学習している。

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, 4 subnets, 2 masks
O       100.0.2.33/32 [110/2] via 100.0.2.2, 00:05:41, GigabitEthernet2/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
C       100.0.2.22/32 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
     10.0.0.0/24 is subnetted, 5 subnets
O E2    10.0.2.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.3.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.1.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.4.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.5.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
R2#

R2は、OSPFのABR(area 0 と area 1)
R1がeigrpからredistributeしたOSPF外部経路を学習している。



R3#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, 4 subnets, 2 masks
C       100.0.2.33/32 is directly connected, Loopback0
O IA    100.0.1.0/30 [110/2] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
O       100.0.2.22/32 [110/2] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
     10.0.0.0/24 is subnetted, 5 subnets
O E2    10.0.2.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.3.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.1.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.4.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.5.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
R3#


R3は、OSPFのarea 0にのみ所属している。
area 1から、100.0.1.0/30 を学習している。
R1のredistributeした経路も、E2として学習している。


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

     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/24 is subnetted, 5 subnets
S       10.0.2.0 is directly connected, Loopback0
S       10.0.3.0 is directly connected, Loopback0
S       10.0.1.0 is directly connected, Loopback0
S       10.0.4.0 is directly connected, Loopback0
S       10.0.5.0 is directly connected, Loopback0
R4#



R4はEIGRPのルータ。

router eigrp 1
 redistribute static metric 100000 100 255 1 1500
 network 20.0.1.0 0.0.0.255
 auto-summary
!
ip route 10.0.1.0 255.255.255.0 Loopback0
ip route 10.0.2.0 255.255.255.0 Loopback0
ip route 10.0.3.0 255.255.255.0 Loopback0
ip route 10.0.4.0 255.255.255.0 Loopback0
ip route 10.0.5.0 255.255.255.0 Loopback0


static routeをredistributeして、R1が学習している。



この、EIGRPから来ている5本の経路が、まず集約できそうだ。


今回考えるケースでは、EIGRPルータの管理は他社が実施していて、
自分で設定変更できるのはOSPFルータだけだとする。

まず、EIGRPから来ている経路を集約する。


R1で

router ospf 1
 log-adjacency-changes
 summary-address 10.0.0.0 255.255.248.0
 redistribute eigrp 1 subnets
 network 100.0.1.0 0.0.0.3 area 1
!
!

10.0.0.0 ~ 10.0.7.255 までを集約した。
(この集約方法でよいかは改めて考える)


集約後の各ルータのルーティングテーブル


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/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA    100.0.2.33/32 [110/3] via 100.0.1.2, 00:27:58, GigabitEthernet1/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
O IA    100.0.2.0/30 [110/2] via 100.0.1.2, 00:51:07, GigabitEthernet1/0
O IA    100.0.2.22/32 [110/2] via 100.0.1.2, 00:20:50, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
D EX    10.0.2.0/24 [170/51456] via 20.0.1.1, 00:36:47, GigabitEthernet2/0
D EX    10.0.3.0/24 [170/51456] via 20.0.1.1, 00:36:47, GigabitEthernet2/0
O       10.0.0.0/21 is a summary, 00:02:01, Null0
D EX    10.0.1.0/24 [170/51456] via 20.0.1.1, 00:36:47, GigabitEthernet2/0
D EX    10.0.4.0/24 [170/51456] via 20.0.1.1, 00:36:20, GigabitEthernet2/0
D EX    10.0.5.0/24 [170/51456] via 20.0.1.1, 00:36:16, GigabitEthernet2/0
R1#


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, 4 subnets, 2 masks
O       100.0.2.33/32 [110/2] via 100.0.2.2, 00:21:03, GigabitEthernet2/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
C       100.0.2.22/32 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.1.1, 00:21:03, GigabitEthernet1/0
     10.0.0.0/21 is subnetted, 1 subnets
O E2    10.0.0.0 [110/20] via 100.0.1.1, 00:02:14, GigabitEthernet1/0
R2#



R3#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, 4 subnets, 2 masks
C       100.0.2.33/32 is directly connected, Loopback0
O IA    100.0.1.0/30 [110/2] via 100.0.2.1, 00:21:11, GigabitEthernet2/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
O       100.0.2.22/32 [110/2] via 100.0.2.1, 00:21:11, GigabitEthernet2/0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.2.1, 00:21:11, GigabitEthernet2/0
     10.0.0.0/21 is subnetted, 1 subnets
O E2    10.0.0.0 [110/20] via 100.0.2.1, 00:02:25, GigabitEthernet2/0
R3#



R4は変化がないので省略




次に、area 0からarea 1に来ている3つの経路を集約する。

O IA    100.0.2.33/32 [110/3] via 100.0.1.2, 00:09:07, GigabitEthernet1/0
O IA    100.0.2.0/30 [110/2] via 100.0.1.2, 00:32:16, GigabitEthernet1/0
O IA    100.0.2.22/32 [110/2] via 100.0.1.2, 00:01:59, GigabitEthernet1/0

この集約はR2でおこなう。


router ospf 1
 log-adjacency-changes
 area 0 range 100.0.2.0 255.255.255.192
 network 100.0.1.0 0.0.0.3 area 1
 network 100.0.2.0 0.0.0.3 area 0
 network 100.0.2.22 0.0.0.0 area 0




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/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
O IA    100.0.2.0/26 [110/2] via 100.0.1.2, 00:00:33, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
D EX    10.0.2.0/24 [170/51456] via 20.0.1.1, 00:42:54, GigabitEthernet2/0
D EX    10.0.3.0/24 [170/51456] via 20.0.1.1, 00:42:54, GigabitEthernet2/0
O       10.0.0.0/21 is a summary, 00:08:09, Null0
D EX    10.0.1.0/24 [170/51456] via 20.0.1.1, 00:42:54, GigabitEthernet2/0
D EX    10.0.4.0/24 [170/51456] via 20.0.1.1, 00:42:27, GigabitEthernet2/0
D EX    10.0.5.0/24 [170/51456] via 20.0.1.1, 00:42:23, GigabitEthernet2/0
R1#



R1#ping 100.0.2.22

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/29/48 ms
R1#ping 100.0.2.33

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.33, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/80/140 ms
R1#
R1#
R1#ping 100.0.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/87/124 ms
R1#ping 100.0.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/52/124 ms
R1#



R2のルーティングテーブルに、Null0あての集約経路が登録される。

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, 5 subnets, 3 masks
O       100.0.2.33/32 [110/2] via 100.0.2.2, 00:01:04, GigabitEthernet2/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
O       100.0.2.0/26 is a summary, 00:01:04, Null0
C       100.0.2.22/32 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.1.1, 00:01:04, GigabitEthernet1/0
     10.0.0.0/21 is subnetted, 1 subnets
O E2    10.0.0.0 [110/20] via 100.0.1.1, 00:01:04, GigabitEthernet1/0
R2#


R3, R4は変化なし