FRR実践④ OSPFv2基本 マルチエリア 確認編
おさらい
本項ではマルチエリア構成時の動作について確認していきます。
経路情報
Rouer_A
Router_A# show ip route
C>* 10.0.0.1/32 is directly connected, lo, 02:20:22
O[1] 172.16.0.0/30 [110/10] is directly connected, eth1, weight 1, 02:20:22
C>* 172.16.0.0/30 is directly connected, eth1, 02:20:22
O[1] 172.16.0.4/30 [110/15] is directly connected, eth2, weight 1, 00:04:23
C>* 172.16.0.4/30 is directly connected, eth2, 02:20:22
O[1] 172.16.0.8/30 [110/15] is directly connected, eth3, weight 1, 00:04:20
C>* 172.16.0.8/30 is directly connected, eth3, 02:20:22
O[1] 172.16.0.12/30 [110/15] is directly connected, eth4, weight 1, 00:04:18
C>* 172.16.0.12/30 is directly connected, eth4, 02:20:22
O[1]>* 172.16.0.16/30 [110/25] via 172.16.0.6, eth2, weight 1, 00:01:08
O[1]>* 172.16.0.20/30 [110/25] via 172.16.0.10, eth3, weight 1, 00:04:20
O[1]>* 172.16.0.24/30 [110/25] via 172.16.0.14, eth4, weight 1, 00:04:18
O[1]>* 192.168.1.0/24 [110/25] via 172.16.0.6, eth2, weight 1, 00:04:23
O[1]>* 192.168.2.0/24 [110/25] via 172.16.0.10, eth3, weight 1, 00:04:20
O[1]>* 192.168.3.0/24 [110/25] via 172.16.0.14, eth4, weight 1, 00:04:18
Router_A# show ip ospf 1 neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.0.2 1 Full/- 2h20m40s 32.147s 172.16.0.2 eth1:172.16.0.1 0 0 0
10.0.0.3 1 Full/Backup 2h20m10s 39.189s 172.16.0.6 eth2:172.16.0.5 0 0 0
10.0.0.4 1 Full/Backup 2h20m00s 31.362s 172.16.0.10 eth3:172.16.0.9 0 0 0
10.0.0.5 1 Full/Backup 2h20m00s 33.547s 172.16.0.14 eth4:172.16.0.13 0 0 0
0 0 0
Router_B以外の接続ではコスト15を明示的に設定しています。また、各IFのリンクスピード(帯域幅)は10Mbps(コスト10)になっていますのでOSPFで学習した経路のコストは合計の25になっていることが分かります。
Router_A# show interface eth2
Interface eth2 is up, line protocol is up
Link ups: 1 last: 2025/05/25 00:20:02.29
Link downs: 0 last: (never)
vrf: default
index 4 metric 0 mtu 1500 speed 10000
flags: <UP,BROADCAST,RUNNING,MULTICAST>
Type: Ethernet
HWaddr: 0c:1a:b8:90:00:02
inet 172.16.0.5/30
inet6 fe80::e1a:b8ff:fe90:2/64
Interface Type Other
Interface Slave Type None
protodown: off
FRRにおけるspeed部分の単位はkbpsのため10Mbpsになります。(=OSPFコスト10)
Router_B
Router_B# show ip route
C>* 10.0.0.2/32 is directly connected, lo, 02:21:38
O[1] 172.16.0.0/30 [110/10] is directly connected, eth1, weight 1, 02:21:38
C>* 172.16.0.0/30 is directly connected, eth1, 02:21:38
O[1]>* 172.16.0.4/30 [110/25] via 172.16.0.18, eth2, weight 1, 00:01:31
O[1]>* 172.16.0.8/30 [110/25] via 172.16.0.22, eth3, weight 1, 00:05:08
O[1]>* 172.16.0.12/30 [110/25] via 172.16.0.26, eth4, weight 1, 00:04:56
O[1] 172.16.0.16/30 [110/10] is directly connected, eth2, weight 1, 00:02:26
C>* 172.16.0.16/30 is directly connected, eth2, 00:02:26
O[1] 172.16.0.20/30 [110/10] is directly connected, eth3, weight 1, 02:21:38
C>* 172.16.0.20/30 is directly connected, eth3, 02:21:38
O[1] 172.16.0.24/30 [110/10] is directly connected, eth4, weight 1, 02:21:38
C>* 172.16.0.24/30 is directly connected, eth4, 02:21:38
O[1]>* 192.168.1.0/24 [110/20] via 172.16.0.18, eth2, weight 1, 00:01:31
O[1]>* 192.168.2.0/24 [110/20] via 172.16.0.22, eth3, weight 1, 02:20:51
O[1]>* 192.168.3.0/24 [110/20] via 172.16.0.26, eth4, weight 1, 02:20:38
Router_B# show ip ospf 1 neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.0.1 1 Full/- 2h21m49s 30.767s 172.16.0.1 eth1:172.16.0.2 0 0 0
10.0.0.4 1 Full/Backup 2h21m17s 32.487s 172.16.0.22 eth3:172.16.0.21 0 0 0
10.0.0.5 1 Full/Backup 2h21m06s 34.677s 172.16.0.26 eth4:172.16.0.25 0 0 0
10.0.0.3 1 Full/DR 2m00s 34.740s 172.16.0.18 eth2:172.16.0.17 0 0 0
Router_AとRouter_Bの接続はNetwork Typeをpoint-to-pointに設定したため、DR/BDRの選出が行わず"-"になっていることが分かると思います。
Router_C
Router_C# show ip route
C>* 10.0.0.3/32 is directly connected, lo, 02:21:44
O[1]>* 172.16.0.0/30 [110/20] via 172.16.0.17, eth7, weight 1, 00:02:14
O[1] 172.16.0.4/30 [110/15] is directly connected, eth6, weight 1, 00:05:59
C>* 172.16.0.4/30 is directly connected, eth6, 02:21:44
O[1]>* 172.16.0.8/30 [110/30] via 172.16.0.5, eth6, weight 1, 00:05:51
O[1]>* 172.16.0.12/30 [110/30] via 172.16.0.5, eth6, weight 1, 00:05:39
O[1] 172.16.0.16/30 [110/10] is directly connected, eth7, weight 1, 00:03:09
C>* 172.16.0.16/30 is directly connected, eth7, 00:03:09
O[1]>* 172.16.0.20/30 [110/20] via 172.16.0.17, eth7, weight 1, 00:02:14
O[1]>* 172.16.0.24/30 [110/20] via 172.16.0.17, eth7, weight 1, 00:02:14
O[1] 192.168.1.0/24 [110/10] is directly connected, eth1, weight 1, 02:21:44
C>* 192.168.1.0/24 is directly connected, eth1, 02:21:44
O[1]>* 192.168.2.0/24 [110/30] via 172.16.0.17, eth7, weight 1, 00:02:14
O[1]>* 192.168.3.0/24 [110/30] via 172.16.0.17, eth7, weight 1, 00:02:14
Router_C# show ip ospf 1 neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.0.1 1 Full/DR 2h22m08s 31.279s 172.16.0.5 eth6:172.16.0.6 0 0 0
10.0.0.2 1 Full/Backup 2m49s 35.312s 172.16.0.17 eth7:172.16.0.18 0 0 0
Router_D
Router_D# show ip route
C>* 10.0.0.4/32 is directly connected, lo, 02:22:23
O[1]>* 172.16.0.0/30 [110/20] via 172.16.0.21, eth7, weight 1, 00:06:32
O[1]>* 172.16.0.4/30 [110/30] via 172.16.0.9, eth6, weight 1, 00:06:32
O[1] 172.16.0.8/30 [110/15] is directly connected, eth6, weight 1, 00:06:32
C>* 172.16.0.8/30 is directly connected, eth6, 02:22:23
O[1]>* 172.16.0.12/30 [110/30] via 172.16.0.9, eth6, weight 1, 00:06:20
O[1]>* 172.16.0.16/30 [110/20] via 172.16.0.21, eth7, weight 1, 00:03:42
O[1] 172.16.0.20/30 [110/10] is directly connected, eth7, weight 1, 02:22:22
C>* 172.16.0.20/30 is directly connected, eth7, 02:22:23
O[1]>* 172.16.0.24/30 [110/20] via 172.16.0.21, eth7, weight 1, 02:22:13
O[1]>* 192.168.1.0/24 [110/30] via 172.16.0.21, eth7, weight 1, 00:02:56
O[1] 192.168.2.0/24 [110/10] is directly connected, eth1, weight 1, 02:22:23
C>* 192.168.2.0/24 is directly connected, eth1, 02:22:23
O[1]>* 192.168.3.0/24 [110/30] via 172.16.0.21, eth7, weight 1, 00:07:00
Router_D# show ip ospf 1 neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.0.1 1 Full/DR 2h22m41s 38.907s 172.16.0.9 eth6:172.16.0.10 0 0 0
10.0.0.2 1 Full/DR 2h22m48s 31.414s 172.16.0.21 eth7:172.16.0.22 0 0 0
Router_E
Router_E# show ip route
C>* 10.0.0.5/32 is directly connected, lo, 02:23:06
O[1]>* 172.16.0.0/30 [110/20] via 172.16.0.25, eth7, weight 1, 00:07:06
O[1]>* 172.16.0.4/30 [110/30] via 172.16.0.13, eth6, weight 1, 00:07:06
O[1]>* 172.16.0.8/30 [110/30] via 172.16.0.13, eth6, weight 1, 00:07:06
O[1] 172.16.0.12/30 [110/15] is directly connected, eth6, weight 1, 00:07:06
C>* 172.16.0.12/30 is directly connected, eth6, 02:23:06
O[1]>* 172.16.0.16/30 [110/20] via 172.16.0.25, eth7, weight 1, 00:04:27
O[1]>* 172.16.0.20/30 [110/20] via 172.16.0.25, eth7, weight 1, 02:22:48
O[1] 172.16.0.24/30 [110/10] is directly connected, eth7, weight 1, 02:22:58
C>* 172.16.0.24/30 is directly connected, eth7, 02:23:06
O[1]>* 192.168.1.0/24 [110/30] via 172.16.0.25, eth7, weight 1, 00:03:41
O[1]>* 192.168.2.0/24 [110/30] via 172.16.0.25, eth7, weight 1, 00:07:48
O[1] 192.168.3.0/24 [110/10] is directly connected, eth1, weight 1, 02:23:06
C>* 192.168.3.0/24 is directly connected, eth1, 02:23:06
Router_E# show ip ospf 1 neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.0.0.1 1 Full/DR 2h23m16s 33.686s 172.16.0.13 eth6:172.16.0.14 0 0 0
10.0.0.2 1 Full/DR 2h23m14s 36.185s 172.16.0.25 eth7:172.16.0.26 0 0 0
Router_C、Router_D、Router_EそれぞれでRouter_A、Router_B向けに経路が存在していますが、
Router_AとのIFではコスト15が設定されいますので、Router_B向け経路が選択さています。
経路確認(Traceroute)
次に端末からの通信がどのような経路を辿るのか確認してみましょう。
Debian-1
debian@debian:~$ traceroute 192.168.2.1
traceroute to 192.168.2.1 (192.168.2.1), 30 hops max, 60 byte packets
1 _gateway (192.168.1.254) 0.856 ms 0.756 ms 0.841 ms
2 172.16.0.17 (172.16.0.17) 1.852 ms 1.786 ms 1.771 ms
3 172.16.0.22 (172.16.0.22) 3.732 ms 4.783 ms 4.774 ms
4 192.168.2.1 (192.168.2.1) 6.460 ms 6.449 ms 6.416 ms
debian@debian:~$ traceroute 192.168.3.1
traceroute to 192.168.3.1 (192.168.3.1), 30 hops max, 60 byte packets
1 _gateway (192.168.1.254) 1.314 ms 1.153 ms 3.020 ms
2 172.16.0.17 (172.16.0.17) 5.020 ms 5.010 ms 5.001 ms
3 172.16.0.26 (172.16.0.26) 7.151 ms 7.142 ms 7.248 ms
4 192.168.3.1 (192.168.3.1) 8.591 ms 8.582 ms 8.572 ms
Debian-2、Debian-3それぞれに向けてRouter_Bを経由していることが分かります。
障害時の経路
一部(Router_B-Router_C間)のリンクをDownさせたときの経路を確認します。
Router_C
Router_C# show ip route
C>* 10.0.0.3/32 is directly connected, lo, 02:53:42
O[1]>* 172.16.0.0/30 [110/25] via 172.16.0.5, eth6, weight 1, 00:00:13
O[1] 172.16.0.4/30 [110/15] is directly connected, eth6, weight 1, 00:01:12
C>* 172.16.0.4/30 is directly connected, eth6, 00:01:12
O[1]>* 172.16.0.8/30 [110/30] via 172.16.0.5, eth6, weight 1, 00:00:17
O[1]>* 172.16.0.12/30 [110/30] via 172.16.0.5, eth6, weight 1, 00:00:17
O[1]>* 172.16.0.20/30 [110/40] via 172.16.0.5, eth6, weight 1, 00:00:13
O[1]>* 172.16.0.24/30 [110/40] via 172.16.0.5, eth6, weight 1, 00:00:13
O[1] 192.168.1.0/24 [110/10] is directly connected, eth1, weight 1, 02:53:42
C>* 192.168.1.0/24 is directly connected, eth1, 02:53:42
O[1]>* 192.168.2.0/24 [110/40] via 172.16.0.5, eth6, weight 1, 00:00:13
O[1]>* 192.168.3.0/24 [110/40] via 172.16.0.5, eth6, weight 1, 00:00:13
Router_E
Router_E# show ip route
C>* 10.0.0.5/32 is directly connected, lo, 02:54:30
O[1]>* 172.16.0.0/30 [110/20] via 172.16.0.25, eth7, weight 1, 00:38:30
O[1]>* 172.16.0.4/30 [110/30] via 172.16.0.13, eth6, weight 1, 00:02:05
O[1]>* 172.16.0.8/30 [110/30] via 172.16.0.13, eth6, weight 1, 00:38:30
O[1] 172.16.0.12/30 [110/15] is directly connected, eth6, weight 1, 00:38:30
C>* 172.16.0.12/30 is directly connected, eth6, 02:54:30
O[1]>* 172.16.0.20/30 [110/20] via 172.16.0.25, eth7, weight 1, 02:54:12
O[1] 172.16.0.24/30 [110/10] is directly connected, eth7, weight 1, 02:54:22
C>* 172.16.0.24/30 is directly connected, eth7, 02:54:30
O[1]>* 192.168.1.0/24 [110/40] via 172.16.0.13, eth6, weight 1, 00:01:06
O[1]>* 192.168.2.0/24 [110/30] via 172.16.0.25, eth7, weight 1, 00:39:12
O[1] 192.168.3.0/24 [110/10] is directly connected, eth1, weight 1, 02:54:30
C>* 192.168.3.0/24 is directly connected, eth1, 02:54:30
Router_Cはそれぞれの端末セグメントに対して、Routr_EはRouter_Cの192.168.1.0/24コストが上乗せされたことが分かります。
Debian-1
debian@debian:~$ traceroute 192.168.2.1
traceroute to 192.168.2.1 (192.168.2.1), 30 hops max, 60 byte packets
1 _gateway (192.168.1.254) 0.948 ms 0.922 ms 1.154 ms
2 172.16.0.5 (172.16.0.5) 2.901 ms 2.891 ms 3.400 ms
3 172.16.0.10 (172.16.0.10) 3.347 ms 3.359 ms 4.128 ms
4 192.168.2.1 (192.168.2.1) 5.299 ms 5.289 ms 5.280 ms
debian@debian:~$ traceroute 192.168.3.1
traceroute to 192.168.3.1 (192.168.3.1), 30 hops max, 60 byte packets
1 _gateway (192.168.1.254) 0.930 ms 0.736 ms 0.672 ms
2 172.16.0.5 (172.16.0.5) 2.634 ms 2.509 ms 2.467 ms
3 172.16.0.14 (172.16.0.14) 3.336 ms 3.326 ms 3.317 ms
4 192.168.3.1 (192.168.3.1) 3.369 ms 3.359 ms 3.457 ms
IFを削除したことでDebian-2、Debian-3それぞれに向けてRouter_Bを経由していることが分かります。
マルチエリアの動作確認
マルチエリアでは、他エリアのルート再計算の影響を受けないのが利点になります。つまり、エリア1のの障害が他エリアに影響が出ないことがエリア分割するひとつの理由になります。
Router_Cのeth7をshutdownしてエリア1のトラフィックを迂回させます。このときに経路の再計算が発生してパケットロスが発生しますが他エリア間通信には影響がないという動作を検証しましょう。
Debian-1とDebian-3でPing
Debian-2とDebian-3でPing
これでエリア1とエリア3、エリア2とエリア3の通信が発生し、エリア1で障害が発生するというシナリオになります。
Router_C
Router_C(config-if)# interface eth7
Router_C(config-if)# shutdown
Debian-1
debian@debian:~$ sudo ping 192.168.3.1
PING 192.168.3.1 (192.168.3.1) 56(84) bytes of data.
64 bytes from 192.168.3.1: icmp_seq=1 ttl=61 time=3.00 ms
64 bytes from 192.168.3.1: icmp_seq=2 ttl=61 time=2.15 ms
64 bytes from 192.168.3.1: icmp_seq=3 ttl=61 time=2.09 ms
64 bytes from 192.168.3.1: icmp_seq=4 ttl=61 time=1.81 ms
64 bytes from 192.168.3.1: icmp_seq=5 ttl=61 time=1.95 ms
64 bytes from 192.168.3.1: icmp_seq=6 ttl=61 time=2.27 ms
64 bytes from 192.168.3.1: icmp_seq=7 ttl=61 time=12.2 ms
64 bytes from 192.168.3.1: icmp_seq=8 ttl=61 time=4.20 ms
64 bytes from 192.168.3.1: icmp_seq=9 ttl=61 time=10.2 ms
64 bytes from 192.168.3.1: icmp_seq=10 ttl=61 time=2.10 ms
64 bytes from 192.168.3.1: icmp_seq=44 ttl=61 time=2.12 ms
64 bytes from 192.168.3.1: icmp_seq=45 ttl=61 time=3.26 ms
64 bytes from 192.168.3.1: icmp_seq=46 ttl=61 time=9.68 ms
64 bytes from 192.168.3.1: icmp_seq=47 ttl=61 time=2.33 ms
64 bytes from 192.168.3.1: icmp_seq=48 ttl=61 time=2.29 ms
Debian-1のPingはRouter_C eth7をshutdownしてから34秒程度のパケットロスののちに復旧しています。(seq-10の次がseq=44)エリア1の切り替わり動作
Debian-2
debian@debian:~$ sudo ping 192.168.3.1
PING 192.168.3.1 (192.168.3.1) 56(84) bytes of data.
64 bytes from 192.168.3.1: icmp_seq=1 ttl=61 time=2.74 ms
64 bytes from 192.168.3.1: icmp_seq=2 ttl=61 time=2.28 ms
64 bytes from 192.168.3.1: icmp_seq=3 ttl=61 time=2.22 ms
64 bytes from 192.168.3.1: icmp_seq=4 ttl=61 time=2.20 ms
64 bytes from 192.168.3.1: icmp_seq=5 ttl=61 time=2.16 ms
64 bytes from 192.168.3.1: icmp_seq=6 ttl=61 time=2.27 ms
64 bytes from 192.168.3.1: icmp_seq=7 ttl=61 time=2.11 ms
64 bytes from 192.168.3.1: icmp_seq=8 ttl=61 time=2.53 ms
64 bytes from 192.168.3.1: icmp_seq=9 ttl=61 time=1.92 ms
64 bytes from 192.168.3.1: icmp_seq=10 ttl=61 time=13.7 ms
64 bytes from 192.168.3.1: icmp_seq=11 ttl=61 time=7.64 ms
64 bytes from 192.168.3.1: icmp_seq=12 ttl=61 time=6.93 ms
64 bytes from 192.168.3.1: icmp_seq=13 ttl=61 time=1.98 ms
64 bytes from 192.168.3.1: icmp_seq=14 ttl=61 time=2.06 ms
64 bytes from 192.168.3.1: icmp_seq=15 ttl=61 time=3.25 ms
64 bytes from 192.168.3.1: icmp_seq=16 ttl=61 time=2.46 ms
64 bytes from 192.168.3.1: icmp_seq=17 ttl=61 time=2.98 ms
64 bytes from 192.168.3.1: icmp_seq=18 ttl=61 time=2.78 ms
64 bytes from 192.168.3.1: icmp_seq=19 ttl=61 time=2.10 ms
64 bytes from 192.168.3.1: icmp_seq=20 ttl=61 time=2.23 ms
64 bytes from 192.168.3.1: icmp_seq=21 ttl=61 time=2.08 ms
64 bytes from 192.168.3.1: icmp_seq=22 ttl=61 time=2.95 ms
64 bytes from 192.168.3.1: icmp_seq=23 ttl=61 time=2.25 ms
64 bytes from 192.168.3.1: icmp_seq=24 ttl=61 time=2.11 ms
64 bytes from 192.168.3.1: icmp_seq=25 ttl=61 time=2.14 ms
64 bytes from 192.168.3.1: icmp_seq=26 ttl=61 time=2.30 ms
対してDebian-2ではPingロスはありません。つまりエリア2、エリア3には影響がないということになります。
これがマルチエリア構成時の障害影響極小化の動作です。パケットロス時間を短くするにはBFDというオプション機能しようすることで短くすることが可能です。これは単純にいうとHelloの送信間隔、監視間隔を短くするものです。
Discussion