MikroTik CHR 6.47 での OSPF 設定例
MikroTik で OSPF ネットワークを設定するサンプルをメモしておきます。
構成
以下の構成としました。 ルータは全て CHR 6.47 を使い、CML 上で検証しました。
設定
設定例は以下の通りです。
CHR-1
| /ip dhcp-client remove 0
/ip address add address=10.0.12.1/24 interface=ether1 network=10.0.12.0
/ip route add distance=1 gateway=10.0.12.2
/system identity set name=CHR-1
|
CHR-2
| /ip dhcp-client remove 0
/ip address add address=10.0.12.2/24 interface=ether1 network=10.0.12.0
/ip address add address=10.0.23.2/24 interface=ether2 network=10.0.23.0
/routing ospf instance set 0 router-id=2.2.2.2
/routing ospf interface add interface=ether1 passive=yes
/routing ospf network add network=10.0.12.0/24 area=backbone
/routing ospf network add network=10.0.23.0/24 area=backbone
/system identity set name=CHR-2
|
CHR-3
| /ip dhcp-client remove 0
/ip address add address=10.0.23.3/24 interface=ether1 network=10.0.23.0
/ip address add address=10.0.34.3/24 interface=ether2 network=10.0.34.0
/routing ospf instance set 0 router-id=3.3.3.3
/routing ospf network add network=10.0.23.0/24 area=backbone
/routing ospf network add network=10.0.34.0/24 area=backbone
/system identity set name=CHR-3
|
CHR-4
| /ip dhcp-client remove 0
/ip address add address=10.0.34.4/24 interface=ether1 network=10.0.34.0
/ip address add address=10.0.45.4/24 interface=ether2 network=10.0.45.0
/routing ospf instance set 0 router-id=4.4.4.4
/routing ospf interface add interface=ether2 passive=yes
/routing ospf network add network=10.0.34.0/24 area=backbone
/routing ospf network add network=10.0.45.0/24 area=backbone
/system identity set name=CHR-4
|
CHR-5
| /ip dhcp-client remove 0
/ip address add address=10.0.45.5/24 interface=ether1 network=10.0.45.0
/ip route add distance=1 gateway=10.0.45.4
/system identity set name=CHR-5
|
OSPF 状態確認
OSPF の状態やルーティングテーブルは以下のコマンドで状態確認出来ます。
/routing ospf route print
/routing ospf neighbor print
/routing ospf interface print
/routing ospf network print
/routing ospf lsa print
/ip route print