sebdar
February 17, 2015, 2:15pm
1
Hi ,
I wonder if someone can help me.
I have 3 interfaces configured.
ethernet 2 WAN1 (192.168.5.3) (behind there is ADSL router 192.168.5.1)
ethernet 3 WAN2 (192.168.3.3) (behind there is aDSL router 192.168.3.1)
ethernet 5 LAN (192.168.1.254) connected to a network (192.168.1.0)
IP routes are set as follow:
First:
Dst. address: 0.0.0.0/0
Gateway: 192.168.5.1
Second:
Dst. address: 0.0.0.0/0
Gateway: 192.168.3.1
I have also set up 2 NAT rules to masquerade Src. Address 192.168.1.0/24 for both WAN Out Interfeces.
Now when I will disconnect WAN1 interface, clients on the LAN network automatically will switch to WAN2.
What I’m trying to achieve is to force a single IP (for example 192.168.1.244) to use only specific WAN (for example WAN1).
How can I achieve that?
Any help appreciated.
sergejs
February 17, 2015, 2:30pm
2
Just configure /ip firewall nat rule, that specifies that client src-address is always masqueraded over specific WAN.
Another thins is that you need additional configuration for such configuration,
First:
Dst. address: 0.0.0.0/0
Gateway: 192.168.5.1
Second:
Dst. address: 0.0.0.0/0
Gateway: 192.168.3.1
otherwise first gateway will be used all the time.
sebdar
February 18, 2015, 8:39am
3
What do you mean by “Another thins is that you need additional configuration for such configuration”?
My NAT config for the single IP looks as follow:
Chain: scr-nat
Src. address: 192.168.1.81
Out. Interface: WAN1
Action: masquerade
Is that what I’m looking for?
sergejs
February 18, 2015, 8:51am
4
What do you mean by “Another thins is that you need additional configuration for such configuration”?
If you just set two default gateways, only one of them is going to work (without additional configuration).
sergejs invites you to explore this topic, have you looked at some examples on wiki.mikrotik.com .
This can help you
http://wiki.mikrotik.com/wiki/Load_Balancing
In the past I used the ECMP and to force some LAN ip to use specific gateway I did:
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-mark=goGW1 passthrough=no src-address=LAN-IP-Address192.168.1.244
/ip route add dst-address=0.0.0.0/0 gateway=192.168.5.3 gateway-status=192.168.5.3 distance=1 scope=30 target-scope=10 routing-mark=goGW1
cetalfio
jprasad
February 22, 2015, 2:50am
6
you can use mangle in the firewall tab.
put your source ip adress go to action tab choose mark routing then make routing mark “wan1”
now go to routes
make route to 0.0.0.0/0
gateway 192.168.5.1%(YOUR WAN1 INTERFACE NAME) (the % forces it to use that interface)
routing mark “wan1”
then your masqurade is like normal