How is it possible ? If it can be setted up witch routing policy, how? I think we need to add rule that allows 178.x.x.x/24 throught gateway 178.x.x.x and network 217.117.x.x throught gateway 217.117.x.x
Please help me.
Thanx
Dave
How is it possible ? If it can be setted up witch routing policy, how? I think we need to add rule that allows 178.x.x.x/24 throught gateway 178.x.x.x and network 217.117.x.x throught gateway 217.117.x.x
Please help me.
Thanx
Dave
Routing 178.x.x.0/24 network through gateway 178.x.x.1 and 217.117.x.0/24 through gateway 217.117.x.1 is very easy → add 2 static routes:
/ip route add dst-address=178.x.x.0/24 gateway=178.x.x.1 distance=1
/ip route add dst-address=217.117.x.0/24 gateway=217.117.x.1 distance=1
OR when you configure your IP addresses of the respective WAN interfaces make sure to add the /24 (or how big your network segment is) to the end, which would result in those static routes being added by default.
Perhaps I’m not understanding your question correctly? Please post a network diagram if you can.
use the ip > route > rules
in ip > route
add 0.0.0.0/0 gateway = 178.y.y.y (the gateway of GW1) mark=GW1
add 0.0.0.0/0 gateway = 217.117.y.y (the gateway of GW2) mark=GW2
done.
Shouldn’t that ^ be other way round, like:
?
if you set the routing policy like that,
then if i have to connect to 178.x.x.x or 217.117.x.x from ip outside the world, let say 125.163.16.1, it will look into the main routing table where it has destination to my ip (125.163.16.1). If none, then it will use 0.0.0.0/0 (default gateway).
The return traffic will just passing through single gateway, not using GW1 or GW2 like we want it.
Since we want to route all the traffic dealing with 178.x.x.x using GW1 and 217.117.x.x using GW2, we must make that policy route like i posted.
I’m confused here…
This is how I see it:
You have a LAN (eg. 10.0.0.0/24) and 2 WAN interfaces (eg. 178.0.0.254/24 (for eth1_WAN_A) and 217.117.0.254/24 (for eth2_WAN_B) with their gateways being 178.0.0.1 (GW A) and 217.117.0.1 (GW B) respectively).

Here is how I would do the routing:
/ip address
add interface=eth0_WAN address=1.2.3.4/32 network=1.1.1.1 broadcast=0.0.0.0
add interface=eth1_WAN_A address=178.0.0.254/24
add interface=eth2_WAN_B address=217.117.0.254/24
/ip route
add dst-address=0.0.0.0/0 gateway=eth0_WAN
add dst-address=0.0.0.0/0 gateway=178.0.0.1 routing-mark=WAN_A
add dst-address=0.0.0.0/0 gateway=217.117.0.1 routing-mark=WAN_B
/ip route rule
add dst-address=178.0.0.0/24 action=lookup table=WAN_A
add dst-address=217.117.0.0/24 action=lookup table=WAN_B
Without the routing policies, the traffic would pass through the default WAN connection (eth0_WAN).
This kind of setup is exactly like I have at home, except that all of my gateways are still private IP addresses (on a WUG & University network).
The WUG hands out 10.20.60.x/24 IP addresses, but then you have no P2P unless you route the 10.20.60.x/24 through the 10.20.60.1 gateway. Previously I’ve done this by adding many static routes (10.20.60.2/31, 10.20.60.4/30, 10.20.60.8/29, … 10.20.60.128/25) to use the 10.20.60.1 gateway, but I’ve now replaced that with 1 single static route and 1 routing policy.
Here’s another example: http://www.mikrotik.com/documentation/manual_2.7/IP/Route.html