目的
Containerlabで構築したFRRで、OSPFの設定をしてみる
IP設定
router1
- eth1: 192.168.1.1
- eth2: 192.168.3.1
router2
- eth1: 192.168.1.2
- eth2: 192.168.2.2
router3
- eth1: 192.168.3.2
- eth2: 192.168.2.1
OSPF
OSPFの有効化
/etc/frr/daemons
ospfd=yes
FRRの再起動
/usr/lib/frr/frrinit.sh restart
or
ホスト側で実行
docker restart frr1
ログイン
vtysh
IPアドレスの設定
conf t
interface eth1
ip address 192.168.1.1/24
conf t
interface eth2
ip address 192.168.3.1/24
OSPFの設定
conf t
router ospf
router-info area 0.0.0.0
network 192.168.1.0/24 area 0.0.0.0
network 192.168.3.0/24 area 0.0.0.0
OSPFにおけるコストの変更
conf t
int eth1
ip ospf cost 500
configの確認
最終的に生成された設定
Building configuration...
Current configuration:
!
frr version 7.5.1_git
frr defaults traditional
hostname router1
no ipv6 forwarding
!
interface eth1
ip address 192.168.1.1/24
ip ospf cost 500
!
interface eth2
ip address 192.168.3.1/24
!
router ospf
network 192.168.1.0/24 area 0.0.0.0
network 192.168.3.0/24 area 0.0.0.0
router-info area
!
line vty
!
end
router2
Building configuration...
Current configuration:
!
frr version 7.5.1_git
frr defaults traditional
hostname router2
no ipv6 forwarding
!
interface eth1
ip address 192.168.1.2/24
ip ospf cost 500
!
interface eth2
ip address 192.168.2.2/24
!
router ospf
network 192.168.1.0/24 area 0.0.0.0
network 192.168.2.0/24 area 0.0.0.0
router-info area
!
line vty
!
end
router3
Building configuration...
Current configuration:
!
frr version 7.5.1_git
frr defaults traditional
hostname router3
no ipv6 forwarding
!
interface eth1
ip address 192.168.3.2/24
!
interface eth2
ip address 192.168.2.1/24
!
router ospf
network 192.168.2.0/24 area 0.0.0.0
network 192.168.3.0/24 area 0.0.0.0
router-info area
!
line vty
!
end
