Community discussions

MikroTik App
 
sreg5y
just joined
Topic Author
Posts: 2
Joined: Mon Apr 25, 2022 11:36 am

Separate wans for dowload and upload traffic

Mon Apr 25, 2022 11:47 am

How to sparate traffic as in this picture?
Image
IPs from different providers and not static.
For external connections I'm using DNS name (IP -> Cloud -> DDNS) and ADD CNAME record with Mikrotik DNS (example: 1a2b3c4d5e6f.sn.mynetname.net.) to my domain (example:
mikrotik.mysite.com)
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

Re: Separate wans for dowload and upload traffic

Mon Apr 25, 2022 2:54 pm

It is not possible. If you send a packet out via WAN1 the remote service sees packets from that IP address and will return replies to the same address, you cannot force the remote service to return packets to a completely different IP address for WAN2.

You can use policy-based routing so that conversations from different devices on your LAN use either WAN1 or WAN2 for sending or receiving, although defining the routing policy can be difficult.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19109
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Separate wans for dowload and upload traffic

Mon Apr 25, 2022 2:55 pm

Your diagram is not clear at all. You need more detail
 
sreg5y
just joined
Topic Author
Posts: 2
Joined: Mon Apr 25, 2022 11:36 am

Re: Separate wans for dowload and upload traffic

Tue Apr 26, 2022 5:38 pm

It is not possible. If you send a packet out via WAN1 the remote service sees packets from that IP address and will return replies to the same address, you cannot force the remote service to return packets to a completely different IP address for WAN2.
I got it, thanks!
You can use policy-based routing so that conversations from different devices on your LAN use either WAN1 or WAN2 for sending or receiving, although defining the routing policy can be difficult.
This variant is suitable for me. I need to configure FILE SERVER in OFFICE1 to work on the WAN2.
WAN2 has a higher download speed.

Image
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19109
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Separate wans for dowload and upload traffic

Wed Apr 27, 2022 6:21 pm

Well thats fairly straightforward (assuming you are using v7 firmware)

You should have two IP routes for the two WANS at the moment and you will note that I gave ISP 1 a lower distance so that all users will be automatically shifted to WAN1
dst-address=0.0.0.0/0 gateway=ISP1-gatewayIP distance=5
dst-address=0.0.0.0/0 gateway=ISP2-gatewayIP distance=10


To ensure the SERVER instead goes to WAN2. Yuu need a third route , a new table (not in v6), and a Route Rule.
dst-address=0.0.0.0/0 gateway=ISP2-gatewayIP distance=10 table=useWAN2

/routing rule add src-address=IPofServer action=lookup-only-in-table table=useISP2
/routing table add name=useISP2 fib

Now you will note that the action above is 'lookup-only-in-table' which means that if WAN2 is not available the Server will not be able to pass traffic. If you wanted the server to have access to WAN1, then you would use the single word action='lookup'

One last thing, assuming you have all the other users on WAN1, and that if WAN1 is not available for any reason they should switch to WAN2. The router will do this because it will see WAN2 as an available route, but to ensure wan1 users go back to WAN1 when it becomes available then modify the first route to.
dst-address=0.0.0.0/0 gateway=ISP1-gatewayIP distance=5 check-gateway=ping

+++++++++++++++++++++
If using V6 firmware one does not create a table but one enters 'useWAN2' as a routing mark on the extra IP route rule.
dst-address=0.0.0.0/0 gateway=ISP2-gatewayIP distance=10 routing-mark=useWAN2

Who is online

Users browsing this forum: jerryuser and 22 guests