Community discussions

MikroTik App
 
IPAUser
just joined
Topic Author
Posts: 6
Joined: Mon Aug 25, 2014 5:19 pm

[Solved] OSPF + Multiple Gateways

Mon Aug 25, 2014 6:00 pm

Hello everyone, this graph should describe pretty well what I'm trying to establish.

Everything is connected through an l2tp/ipsec tunnel (which works perfectly) and on top of that im trying to create a ospf network which gives me some trouble.

First of all i'll try to explain why I made this kind of a configuration - i guess my routing table is the problem but I'm not sure how to make everything work otherwise.

The problem i'm having is with the router on the left (2 Lan gateways on the same subnet + 2 WAN-gateways in the same subnet). I'm trying to route traffic that goes into the 192.168.1.250 gateway through the 2.2.1.3/29 IP and the other internal gateway (192.168.1.254) through the other address (2.2.1.2/29). i accomplished this with the following lines:
/ip address
add address=2.2.1.2/29 interface=ether6 network=2.2.1.1
add address=2.2.1.3/29 interface=ether7 network=2.2.1.1
add address=192.168.1.254/24 interface=ether1 network=192.168.1.0
add address=192.168.1.250/24 interface=ether2 network=192.168.1.0

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether6 to-addresses=0.0.0.0
add action=masquerade chain=srcnat out-interface=ether7 routing-mark=wan2 \
to-addresses=0.0.0.0

/ip route
add distance=1 gateway=2.2.1.1%ether7 routing-mark=wan2
add distance=1 gateway=2.2.1.1%ether6

/ip firewall mangle
chain=prerouting action=mark-routing new-routing-mark=wan2 passthrough=no
dst-address-list=!lan1 in-interface=ether2
(the adress list is containing the 192.168.1.0/24 network)


This actually works perfectly, unfortunately the ospf network won't work, the 192.168.1.0/24 is getting advertised twiece (i want the 250 local gateway to be in charge of the VPN traffic and not both local gateways). As well pinging won't give me positive results, i know that the ipsec and ospf configuration would be fine otherwise, since using 2 Mikrotiks make my configuration work without a problem. From what i understand is the static interface route a problem for the ospf network, does anyone have advice on how to fix that? Also i'm wondering if i could reduce the amount of ports im using, but that would just be a little extra.

Thank you a lot in advance, i hope it's clear what i'm trying to do
You do not have the required permissions to view the files attached to this post.
Last edited by IPAUser on Mon Sep 08, 2014 11:04 am, edited 1 time in total.
 
IPAUser
just joined
Topic Author
Posts: 6
Joined: Mon Aug 25, 2014 5:19 pm

Re: OSPF + Multiple Gateways

Thu Aug 28, 2014 3:50 pm

Can anybody give me at least a hint or an idea how to set this up? i would also be fine with just using one port on the wan/lan side, i just really don't have a full test environment for setting this up and i can't really test too much during the working hours.

Any kind of help would be really appreciated!
 
User avatar
Kickoleg
Member Candidate
Member Candidate
Posts: 129
Joined: Tue Mar 11, 2014 3:13 pm
Location: Yverdon-les-Bains, Suisse

Re: OSPF + Multiple Gateways

Fri Aug 29, 2014 7:55 pm

Actually it is not set up correctly... You need Loopback address for all points with /32 IPs ... After that setup OSPF between loopback interefaces and change cost of path ....
 
IPAUser
just joined
Topic Author
Posts: 6
Joined: Mon Aug 25, 2014 5:19 pm

Re: OSPF + Multiple Gateways

Mon Sep 08, 2014 11:04 am

Thanks that helped a lot!

By the way it's also important to note, that you have to set the ether1 port as a passive interface (in ospf) so this route is not getting distributed.

Now i still have to set up that the ether 7 port is in charge of the VPN, but this can be looked up in these threads (if anyone else tries to setup something similar):

http://forum.mikrotik.com/viewtopic.php?f=2&t=54228
http://forum.mikrotik.com/viewtopic.php?f=2&t=40751

Who is online

Users browsing this forum: No registered users and 20 guests