🏡
FRR実践③ OSPFv2基本 DR BDR DROTHER Config編
DR/BDR/Drotherの動作が分かる構成を作ってみる。
まずは作ってみます。これまでの構成とは異なるので新しくGNS3のプロジェクトを作成しました。
なかなかこのようなネットワーク構成は現実的ではないかと思いますが動作をわかりやすくするためにSwitch1を起点(同一セグメント)に4台同一エリアのOSPFを構成しています。(Switch1をL2VPNや広域イーサネットなどの回線サービスに見立てれば無くはないか)
Config
どのルーターもパラメーターが異なるだけで同様のConfigです。
ポイントはルーターIDとプライオリティの関係性になります。動作を次項で解説しますが、あえて入れ違いになるように設定しています。
ホスト名 | RouterID | Priority |
---|---|---|
Router_A | 10.0.0.1 | 255 |
Router_B | 10.0.0.2 | 255 |
Router_C | 10.0.0.3 | 253 |
Router_D | 10.0.0.4 | 254 |
また、DR/BDRの選出とは関係ないですが、端末と接続するIFにはip ospf passiveを入れています。
パッシブインターフェースはOSPFのネットワークには広報するが設定したIFにはHELLOパケットを送信しない設定となります。
IFの先にOSPFを構成するルーターがいない場合(L2スイッチや端末のみ)に設定します。
Router_A
Router_A# show running-config
Building configuration...
Current configuration:
!
frr version 8.2.2
frr defaults traditional
hostname frr
hostname Router_A
service integrated-vtysh-config
!
interface eth1
ip address 192.168.1.254/24
ip ospf 1 area 0
ip ospf passive
exit
!
interface eth7
ip address 172.16.0.1/29
ip ospf 1 area 0
ip ospf priority 255
exit
!
interface lo
ip address 10.0.0.1/32
exit
!
router ospf 1
ospf router-id 10.0.0.1
exit
!
end
Router_B
Router_B# show running-config
Building configuration...
Current configuration:
!
frr version 8.2.2
frr defaults traditional
hostname frr
hostname Router_B
service integrated-vtysh-config
!
interface eth1
ip address 192.168.2.254/24
ip ospf 1 area 0
ip ospf passive
exit
!
interface eth7
ip address 172.16.0.2/29
ip ospf 1 area 0
ip ospf priority 255
exit
!
interface lo
ip address 10.0.0.2/32
exit
!
router ospf 1
ospf router-id 10.0.0.2
exit
!
end
Router_C
Router_C# show running-config
Building configuration...
Current configuration:
!
frr version 8.2.2
frr defaults traditional
hostname frr
hostname Router_C
service integrated-vtysh-config
!
interface eth1
ip address 192.168.3.254/24
ip ospf 1 area 0
ip ospf passive
exit
!
interface eth7
ip address 172.16.0.3/29
ip ospf 1 area 0
ip ospf priority 253
exit
!
interface lo
ip address 10.0.0.3/32
exit
!
router ospf 1
ospf router-id 10.0.0.3
exit
!
end
Router_D
Router_D# show running-config
Building configuration...
Current configuration:
!
frr version 8.2.2
frr defaults traditional
hostname frr
hostname Router_D
service integrated-vtysh-config
!
interface eth1
ip address 192.168.4.254/24
ip ospf 1 area 0
ip ospf passive
exit
!
interface eth7
ip address 172.16.0.4/29
ip ospf 1 area 0
ip ospf priority 254
exit
!
interface lo
ip address 10.0.0.4/32
exit
!
router ospf 1
ospf router-id 10.0.0.4
exit
!
end
Discussion