Skip to content

MikroTik CHR 6.47 での OSPF 設定例

MikroTik で OSPF ネットワークを設定するサンプルをメモしておきます。

構成

以下の構成としました。 ルータは全て CHR 6.47 を使い、CML 上で検証しました。

file

設定

設定例は以下の通りです。

CHR-1

1
2
3
4
/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

1
2
3
4
5
6
7
8
/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

1
2
3
4
5
6
7
/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

1
2
3
4
5
6
7
8
/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

1
2
3
4
/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 の状態やルーティングテーブルは以下のコマンドで状態確認出来ます。

  1. /routing ospf route print
  2. /routing ospf neighbor print
  3. /routing ospf interface print
  4. /routing ospf network print
  5. /routing ospf lsa print
  6. /ip route print