What do i need to change to add ospf to my network?

I want to setup ospf on my networks, but first want to know what i need to do.

Will i still need to “add dst-network=0.0.0.0/0 gateway=previous mikrotik” to ip route?
I usually used static routes, will i benifit from dynamic routing?

When you enable OSPF, you don’t need static routes anymore.

That good news, im having trouble setting it up. I tried to set it up between two routers.

router1 eth1 (192.168.100.250/24), wlan1 (172.16.0.201/30)

router2 eth1 (192.168.0.200/24), wlan1 (172.16.0.202(30)

I have added this to both routers.

routing ospf network add network=172.16.0.0/24
area: backbone

Is this correct?
PS: my whole network will run on 172.16.0.0/24

first i would look up what to set in OSPF so it works better over wireless link, since OSPF by default use multicast, so you have to turn it off.

and second, you have to announce some other routes, that will be propagated over the network, like your 2 subnets can be announces if you set up distribution of connected networks.

OSPF configuration itself is correct. Now you need to distribute static routes.
in /routing ospf instance set default redistribute-connected=as-type-1

i try that now

So far is looks great. thank you.

I tried to setup it on my main wifi. And it works

Would u recommend NBMA networks?

In http://wiki.mikrotik.com/wiki/Manual:OSPF-examples they say it is more stable.

thank you very much.

PS: When will i use /routing ospf instance set default redistribute-connected=as-type-2

The new routing looks correct but somehow i am unable to ping the remote ip address on the mikrotik.

I can ping all the ip’s on the first router but not the seond router. Might it be becos im using mangle rules, routing rules and that i have to gateways?

The mangle and routing rules on router one looks like this.

router1 mangle

[admin@KKT-HS] > ip firewall mangle print
Flags: X - disabled, I - invalid, D - dynamic
 0   ;;; Derick Home
     chain=prerouting action=mark-routing new-routing-mark=KKT
     passthrough=yes src-address=192.168.13.0/24
     in-interface=www.odnwug.za.net 2.4ghz

 1   ;;; Hannes Home
     chain=prerouting action=mark-routing new-routing-mark=KKT
     passthrough=yes src-address=192.168.10.0/24 in-interface=Hannes-Link 1

 2   ;;; LB de Wet Home
     chain=prerouting action=mark-routing new-routing-mark=KKT
     passthrough=yes src-address=192.168.11.0/24 in-interface=Hannes-Link 1

 3   ;;; Trok Afdeling
     chain=prerouting action=mark-routing new-routing-mark=KKT
     passthrough=yes src-address=192.168.12.0/24 in-interface=Hannes-Link 1

 4   ;;; Emile Home
     chain=prerouting action=mark-routing new-routing-mark=KKT
     passthrough=yes src-address=192.168.4.0/24 in-interface=Emile-Link 1

 5   ;;; Test
     chain=prerouting action=mark-routing new-routing-mark=WUG
     passthrough=yes src-address=192.168.16.0/24

[admin@KKT-HS] >

ip route rules

[admin@KKT-HS] > ip route rule print
Flags: X - disabled, I - inactive
 0   ;;; Hannes Home
     src-address=192.168.10.0/24 action=lookup table=KKT

 1   ;;; LB de Wet Home
     src-address=192.168.11.0/24 action=lookup table=KKT

 2   ;;; Emile Home
     src-address=192.168.4.0/24 action=lookup table=KKT

 3   ;;; KKT Trok afdeling
     src-address=192.168.12.0/24 action=lookup table=KKT

 4   ;;; Derick Home
     src-address=192.168.13.0/24 action=lookup table=KKT

 5   ;;; Test
     src-address=192.168.16.0/24 action=lookup table=WUG

 6   ;;; Test
     src-address=192.168.17.0/24 action=lookup table=WUG
[admin@KKT-HS] >

Ip route before ospf

[admin@KKT-HS] /ip route> print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
 #      DST-ADDRESS        PREF-SRC        G GATEWAY              DISTANCE IN..
 0 A S  0.0.0.0/0                          r 172.16.0.200         1        br..
 1 A S  0.0.0.0/0                          r 172.16.0.201         1        br..
 2 ADC  172.16.0.0/24      172.16.0.1                             0        br..
 3 A S  172.16.1.0/24                      r 172.23.128.2         1        Em..
 4 ADC  172.16.2.0/24      172.16.2.0                             0        ww..
 5 ADC  172.23.128.0/30    172.23.128.1                           0        Em..
 6 ADC  172.23.128.4/30    172.23.128.5                           0        Ha..
 7 ADC  192.168.13.0/24    192.168.13.1                           0        ww..
 8 A S  192.168.16.0/24                    r 172.23.128.6         1        Ha..
 9 A S  192.168.17.0/24                    r 172.23.128.6         1        Ha..
[admin@KKT-HS] /ip route>

Ip router after ospf

[admin@KKT-HS] /ip route> print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
 #      DST-ADDRESS        PREF-SRC        G GATEWAY              DISTANCE I
 0 A S  0.0.0.0/0                          r 172.16.0.200         1        b
 1 A S  0.0.0.0/0                          r 172.16.0.201         1        b
 2 ADC  172.16.0.0/24      172.16.0.1                             0        b
 3 ADC  172.16.2.0/24      172.16.2.0                             0        w
 4 ADC  172.23.128.0/30    172.23.128.1                           0        E
 5 ADC  172.23.128.4/30    172.23.128.5                           0        H
 6 ADo  172.23.128.108/30                  r 172.23.128.6         110      H
 7 ADo  172.23.128.112/28                  r 172.23.128.6         110      H
 8 ADC  192.168.13.0/24    192.168.13.1                           0        w
[admin@KKT-HS] /ip route>