With 2 wan connections, A and B,
Which would be the rules in mangle to force a client (computer inside LAN) go through connection A or B?
I've tested with this configuration, but does not work as expected:
Routes:
Code: Select all
/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
@gwA,@gwB scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
@gwA pref-src=@ipA routing-mark=adsl1 scope=30 \
target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
@gwB pref-src=@ipB routing-mark=adsl2 scope=30 \
target-scope=10
Code: Select all
/ip firewall mangle
add action=mark-connection chain=prerouting comment="force adsl2" \
connection-state=new disabled=no in-interface=lan new-connection-mark=\
Client-adsl2 passthrough=yes src-address=172.16.0.200
add action=mark-routing chain=prerouting comment="Route mark" \
connection-mark=Client-adsl1 connection-state=new disabled=no \
new-routing-mark=adsl1 passthrough=no
add action=mark-routing chain=prerouting comment="" connection-mark=\
Client-adsl2 connection-state=new disabled=no new-routing-mark=adsl2 \
passthrough=no
/ip firewall nat
add action=src-nat chain=srcnat comment="" disabled=no routing-mark=adsl1 \
to-addresses=@ipA
add action=src-nat chain=srcnat comment="" disabled=no routing-mark=adsl2 \
to-addresses=@ipB
There are no more rules or rutes. The idea is to change connection mark to "client-adsl1" or "client-adsl2"
to force A or B
I'm doing a traceroute from client 172.16.0.200 (forced to adsl2) (client is also a routeros).
Sometimes (maybe 1/2) the second hop is @gwB but others it gaves me a timeout.
With packet sniffer I see packets going out through connection A with src-address @ipB.
Wich would be the configuration of mangle?
Do I need route rules?
Someone can explain why are packets going out through conn B with src-addres @ipA?
Someone has a similar setup and could post or send the rules?
I think this setup is fairly simple and should not be an "advanced" topic.