🏡

FRR実践② OSPFv2基本 確認編

に公開

おさらい

前回は最低限のConfigでOSPFを構成しました。シングルエリアのOSPF
https://zenn.dev/labathome/articles/535d6cd7c1e5c6

構成したネットワークについてShowコマンドの出力をもとに解説していきます。

show ip ruote

各ルーターともに自ルーターのIFは"C"になっているは直接接続であるからでスタティックルートの時と同じです。1ホップ以遠のネットワークをOSPFで学習しているので"O"になっていますね。スタティックルートときはここが"S"でした。
スタティックルートでは目的のネットワークに対してのゲートウェイとなるルーターIF(IP)を手動設定で指定するのに対して、OSPFは自動で学習してくれることがわかるかと思います。(Configで宛先ネットワークは設定していませんので。)

Router_A

Router_A# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 10.0.0.1/32 is directly connected, lo, 00:26:43
O[1]   172.16.0.0/30 [110/10] is directly connected, eth7, weight 1, 00:16:24
C>* 172.16.0.0/30 is directly connected, eth7, 00:26:43
O[1]>* 172.16.0.4/30 [110/20] via 172.16.0.1, eth7, weight 1, 00:15:32
O[1]   192.168.1.0/24 [110/10] is directly connected, eth1, weight 1, 00:26:43
C>* 192.168.1.0/24 is directly connected, eth1, 00:26:43
O[1]>* 192.168.2.0/24 [110/30] via 172.16.0.1, eth7, weight 1, 00:15:19

Router_B

Router_B# show ip route

C>* 10.0.0.2/32 is directly connected, lo, 00:18:45
O[1]   172.16.0.0/30 [110/10] is directly connected, eth1, weight 1, 00:18:45
C>* 172.16.0.0/30 is directly connected, eth1, 00:18:45
O[1]   172.16.0.4/30 [110/10] is directly connected, eth2, weight 1, 00:17:53
C>* 172.16.0.4/30 is directly connected, eth2, 00:18:45
O[1]>* 192.168.1.0/24 [110/20] via 172.16.0.2, eth1, weight 1, 00:18:35
O[1]>* 192.168.2.0/24 [110/20] via 172.16.0.6, eth2, weight 1, 00:17:40

Router_C

Router_C# show ip route

C>* 10.0.0.3/32 is directly connected, lo, 00:18:27
O[1]>* 172.16.0.0/30 [110/20] via 172.16.0.5, eth7, weight 1, 00:18:09
O[1]   172.16.0.4/30 [110/10] is directly connected, eth7, weight 1, 00:18:27
C>* 172.16.0.4/30 is directly connected, eth7, 00:18:27
O[1]>* 192.168.1.0/24 [110/30] via 172.16.0.5, eth7, weight 1, 00:18:09
O[1]   192.168.2.0/24 [110/10] is directly connected, eth1, weight 1, 00:18:27
C>* 192.168.2.0/24 is directly connected, eth1, 00:18:27

show ip ospf neighbor

ネイバー情報では隣接するルーター(ルーターID)についてどのIF(アドレス)から情報をもらっているかが分かります。また、DR/BDR/DROTHERの関係性を知ることができます。
Router_Aを参考に説明すると、10.0.0.2の隣接ルータはeth7の先にある172.16.0.1から情報が来ているということになります。StateがBackupとなっていますので10.0.0.2はBDRであることが分かります。
なお、同一セグメント上に3台以上のルーターがいない場合はDROTHERは作成されません。

DRの役割はセグメント内のLSAを集約してルーター間と同期をとることで各ルーターが同じLSDBを構成させる役割をもつ代表ルーターです。DRが不在になればBDRがDRになります。

Router_A

Router_A# show ip ospf 1 neighbor

OSPF Instance: 1


Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.0.2          1 Full/Backup     4h57m48s          30.891s 172.16.0.1      eth7:172.16.0.2                      0     0     0

Router_B

Router_B# show ip ospf 1 neighbor

OSPF Instance: 1


Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.0.1          1 Full/DR         4h59m24s          36.078s 172.16.0.2      eth1:172.16.0.1                      0     0     0
10.0.0.3          1 Full/Backup     4h58m25s          37.325s 172.16.0.6      eth2:172.16.0.5                      0     0     0

Router_C

Router_C# show ip ospf 1 neighbor

OSPF Instance: 1


Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.0.2          1 Full/DR         4h59m02s          37.756s 172.16.0.5      eth7:172.16.0.6                      0     0     0

ここまででとりあえずOSPFを動かしてみることができました。
次項ではDR/BDR/DROTHERの動作に着目して構成してみます。

Discussion