Here’s a really simple OSPF setup on two Ubiquiti Edge Router Lites.
Two ERLs hooked together via eth0.
ERL20 <-> ERL10
192.168.20.1 192.168.1.2 <-> 192.168.1.1 192.168.10.1
on ERL20 get into configure and run the following:
1 2 3 4 5 6 7 8 9 |
# give this router an id. set protocols ospf parameters router-id 192.168.20.1 # 0.0.0.0 is backbone. Add in networks to advertise. set protocols ospf area 0.0.0.0 network 192.168.1.0/24 set protocols ospf area 0.0.0.0 network 192.168.20.0/24 # enable ospf on eth0 interface (going to ERL10) set interfaces ethernet eth0 ip ospf |
on ERL10 get into configure and run the following.
1 2 3 4 5 6 7 8 9 |
# give this router an id. set protocols ospf parameters router-id 192.168.10.1 # 0.0.0.0 is backbone. Add in networks to advertise. set protocols ospf area 0.0.0.0 network 192.168.1.0/24 set protocols ospf area 0.0.0.0 network 192.168.10.0/24 # enable ospf on eth0 interface (going to ERL20) set interfaces ethernet eth0 ip ospf |
run ‘commit’ on both them, (‘save’ if you want to) and ‘exit’ to prompt.
Now watch ospf work it’s magic.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
jdrews@ERL10:~$ show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.20.1 1 2-Way/DROther 34.213s 192.168.1.2 eth0:192.168.1.1 0 0 0 jdrews@ERL20:~$ show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.10.1 1 2-Way/DROther 36.422s 192.168.1.1 eth0:192.168.1.2 0 0 0 jdrews@ERL10:~$ show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.20.1 1 ExStart/DR 30.837s 192.168.1.2 eth0:192.168.1.1 0 0 0 jdrews@ERL20:~$ show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.10.1 1 Full/Backup 39.764s 192.168.1.1 eth0:192.168.1.2 2 0 0 jdrews@ERL10:~$ show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.20.1 1 Full/DR 39.674s 192.168.1.2 eth0:192.168.1.1 1 0 0 |
Now you should have routes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
jdrews@ERL10:~$ show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - ISIS, B - BGP, > - selected route, * - FIB route C>* 127.0.0.0/8 is directly connected, lo O 192.168.1.0/24 [110/10] is directly connected, eth0, 00:11:40 C>* 192.168.1.0/24 is directly connected, eth0 O 192.168.10.0/24 [110/10] is directly connected, eth1, 00:11:39 C>* 192.168.10.0/24 is directly connected, eth1 O>* 192.168.20.0/24 [110/20] via 192.168.1.2, eth0, 00:10:58 jdrews@ERL20:~$ show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - ISIS, B - BGP, > - selected route, * - FIB route C>* 127.0.0.0/8 is directly connected, lo O 192.168.1.0/24 [110/10] is directly connected, eth0, 00:11:34 C>* 192.168.1.0/24 is directly connected, eth0 O>* 192.168.10.0/24 [110/20] via 192.168.1.1, eth0, 00:10:44 O 192.168.20.0/24 [110/10] is directly connected, eth1, 00:11:33 C>* 192.168.20.0/24 is directly connected, eth1 |
is it possible to advertise by OSPF only certain hosts from a network? not the entire network…
Hi,
I am trying to connect to edge router pros together in a similar manner. We want to use one as a firewall and the main gateway to the other router who’s job it will be to connect to our switches and route network traffic. I have followed your instructions exactly, but cant seem to get it to work. any ideas?