i’m struggled with configuring 2 wans from same ISP which share same ISP’s gateway.
i created manualy 2 routes:
add distance=2 gateway=x.x.x.0%TIS_15 pref-src=x.x.x.207
add distance=1 gateway=x.x.x.0.0%TIS_100 pref-src=x.x.x.22
route with distance 1 is active although route with distance 2 is not active,but enabled (so all lan ips routed to this interface don’t have internet). can you point me, what should i do?
i have lot’s of mangle rules which are working well and if should i create another 1 or 2? i need both wan interfaces work same time (not failover), for different local subnets.
If the ISP is using PPPoE, ask them if they can support MLPPP - you can then bond the two using MLPPP and it will automatically do all of the load-balancing and fault protection for you.
i don’t need any kind of load-balancing. i have 1 wan for internet from my lan (working) and 2 wan for published services (different subnet). and no, my ISP doesn’t provide any additional services free of charge (especially MLPPP). both wan with static public ip.
no thoughts? i’ve tried many ways already, but it just doesn’t want to work. i know how to make it work using cisco ios, but no clue in routeros.
trick with % doesn’t work (in one route, 2 gateways and 2 routes with same gateway with %). also, tried to put pref-src, still nothing.
i have 1 wan for internet from my lan (working) and 2 wan for published services (different subnet).
If shortly:
Set default gateway to the first provider in the main routing table (i.e. no routing mark set in route).
Create the other routing table with different name (for example, routing mark set as “WAN2”) and set default gateway to the second provider in this table .This table will be used for marked connections only.
Mark connections incoming to wan2 for example “to_wan2” (mark connections as “to_wan2” in forward chain for wan2 interface as input) and use second routing table for marked connections for outgoing to global packets (do mark routing as “WAN2” in prerouting chain for packets coming from lan interface and going to global dst addresses).
Of course dst-nat on wan2 for published services.
If you want to force some services to use wan2 for Internet access (from lan to global) - add corresponding mark routing as WAN2 rule in prerouting chain - for example, set mark route as wan2 for connections from certain src-address to global dst-addresses.
Remember - mark connection just marks connection. And nothing more. Packet goes as usually. Which route table to use is set by further mark routing rules.
thanks. created 2 routing tables (main and other) , created 2 routes, default and second marked and it works, even without marking traffic in mangle. i just don’t use masquarade, only src-nat with " to ip address".
hi again, strange but scheme works only sometimes, i.e. it works now, but later, in 10 minutes i see it doesn’t work.
check, if everything is correct (published-7 is lan, 10.10.254.0 lan subnet, x.x.x.207 public ip):
mangle:
add action=mark-connection chain=forward in-interface=tis115 new-connection-mark=to_tis115 passthrough=no
add action=mark-routing chain=prerouting connection-mark=to_tis115 dst-address=x.x.x.207 in-interface=published-7 new-routing-mark=TIS15 passthrough=no
add action=mark-routing chain=prerouting dst-address=x.x.x.207 new-routing-mark=TIS15 passthrough=no src-address=10.10.254.0/24
add action=mark-routing chain=prerouting dst-address=8x.x.x.207 new-routing-mark=TIS15 passthrough=no
Ok. I propose to start from every beginning %) becuase I suspect that we talk about different little bit things.
Please paint diagram - you network and that you want exactly to get. With subnets, gates, etc.
WAN1&WAN2 (PPPoE statis IP’s) links come from same ISP (same gateway). Published servers on 10.10.254.0/24 subnet. Also i need to access internet from 10.10.254.0/24
Othe subnets are working very well with WAN1 link
/ip route
add dst-address=0.0.0.0/0 gateway=(the interface on which x.x.x.207 is set) routing-mark=via-207
add dst-address=0.0.0.0/0 gateway=(the interface on which x.x.x.22 is set) routing-mark=via-22
(i think there is a mistake in your diagram, the gateway provided by your isp can be x.x.x.0 in certain conditions, but i don’t think that is your case, so i assume is x.x.x.1)
this should work (you could also add a default route without any routing-mark, for traffic originating from the router itself.
after that you can add masquerading or other nat-ing.
To clarify - published servers should be accessible from Internet via WAN2 and go to the Internet via same WAN2 only?
All other - non published - should use only WAN1?
Later I will do sample configuration for testing and if all Ok - will publish here config.
Just playing with similar to your network - see work config below.
I started from default config.
Here is I show two possible ways - route rules (variant 1) and mangle mark route (variant 2). Here they are equal. But variant 2 is more flexible.
In the case if you wish publish same services via both wan’s in the same time - mark connections rules needed.