I have a couple of WAN Connection. One of them is 50Mbps and other 30Mbps.
WAN1: 10.10.1.1 (30Mbps)
WAN2: 10.10.2.1 (50 Mbps)
My Lan has two group. Group 1 wants use WAN1 and Group 2 wants use WAN2.
with Address List I defined an address list of group 2:
/ip firewall address-list
add address=192.168.1.200-192.168.1.254 disabled=no list=Group 2
Then in Mangle I marked them:
IP/Firewall/Mangle
0 chain=prerouting action=mark-routing new-routing-mark=Group 2 passthrough=no src-address-list=Group 2
for accessing winbox from outside I define a filter rule:
/ip firewall filter
add action=accept chain=input comment=winbox-remote disabled=no dst-port=8291 protocol=tcp
But my problem is:
I cannot access my winbox from outside
I cannot ping my WAN connections.
I cannot ping outside from router and I receive “no route to host” message
You mark routing only for outgoing connections from LAN. But router also needs some help with incoming connections, specifically with reply packets. Whole working config with explanation can be seen in PCC manual. The part you’re interested in is (change it to your interface names and routing marks):
Both 1) and 2) assume that your WAN connections have some modems with public addresses and you forward traffic from there to 10.10.x.2, otherwise you can’t have any connections from outside.
This is the usual problem with multiple WANs. You have two new routing tables and they work well for outgoing traffic, because you mark it to use these tables. But when a new connection from outside comes to router, router sends reply according to “main” routing table. It doesn’t automatically track from where the connection originally came from, it just uses active default route, which might or might not be the right one.
These new mangle rules fix it. First they they mark connections coming from each WAN (in chain=prerouting) and then they mark routing for outgoing packets of marked connections (in chain=output). It makes router look into the right routing table and reply packets will take the right way back.
If you’re only interested in access to router itself, these are enough. Just change them to your naming, i.e. “in-interface=ether2-30M” instead of “in-interface=ISP1”, “new-routing-mark=Group 1” instead of “new-routing-mark=to_ISP1”, etc.
If you’d want to have some forwarded ports to internals machines accessible from both WANs, you’d also need: