Community discussions

MikroTik App
 
gableoley
just joined
Topic Author
Posts: 10
Joined: Wed Jun 08, 2016 9:10 pm

two wan redirect a port to one of them from LAN upload only

Thu Jun 23, 2016 1:42 am

I have two wan, and want to redirect a specific port to only one of them from LAN (upload only), is there a way? thanks in advance.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: two wan redirect a port to one of them from LAN upload only

Thu Jun 23, 2016 4:25 pm

This probably cannot be done in the way you mean.
I take your question to mean that you want to redirect high-bandwidth uploads to a particular ISP, and leave the other link free for other things.

If both links are to the same ISP and you can use the same public IP address on both of them, then this is possible.
If the two connections aren't using NAT and can be routed either/or, then sending all upstream traffic over link A and receiving all downstream traffic over link B is pretty straightforward - simply tweak the IP routes at both ends to favor the appropriate link at each end, and have the other link configured as a backup route (higher administrative distance value)

I'm 99.999% certain though, that you either have two different ISPs or else two links to the same ISP, but with different IP addresses on them.
This means that you cannot achieve what you want. Even though it's quite common to talk about Internet connections as "uploads" or "downloads", the reality is that all connections are bi-directional. When TCP makes a connection to some host, it doesn't know what is going to happen across this connection. It doesn't know if a user plans to upload a video to YouTube or download the updates to their entire Steam catalog. As such, the connection can be routed based on several criteria, some of which involve the current load of each ISP connection, but once the connection is routed through a certain ISP, then it must STAY through that ISP (actually, it must stay through the same IP address) and so if it turns out that the majority of the data segments are being sent in the "upload" direction, and the connection was made across the "download" ISP, then that's just too bad because you can't switch the connection over to a different IP address on your end (not in the router anyway - because TCP is end-to-end), so you can't swing the "upload" traffic onto the "upload" ISP.

It gets even more nuanced than this, because every TCP connection sends lots of upstream segments - when downloading, every few blocks of data requires the recipient to send an acknowledgement that the data arrived successfully. These ACK messages are small, but they do create an stream of "upload" data even during a download. You would have to be careful to know the difference between the ACKs of a download connection vs. the larger utilization of an upload.
When given a spoon,
you should not cling to your fork.
The soup will get cold.
 
gableoley
just joined
Topic Author
Posts: 10
Joined: Wed Jun 08, 2016 9:10 pm

Re: two wan redirect a port to one of them from LAN upload only

Thu Jun 23, 2016 6:26 pm

I have an RB750UP with firmware 6.35.4 as load balancer two wan same isp different dynamic ip, I want to send my DVR upload traffic to one of the wan interfaces.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: two wan redirect a port to one of them from LAN upload only

Thu Jun 23, 2016 6:50 pm

You can force the DVR specifically onto one ISP but that will also cause its downloads to come from that ISP as well, but this will probably be the closest thing to your desired solution that can be achieved.

In your mangle rules, there is eventually a rule which begins the load balance portion (usually a PCC match) - insert a new rule just before this, where the new rule matches src-address=ip.of.DVR and has the action to mark-connection=ISP2 (or whatever mark you're using to select the ISP in question).
This should be the only rule you need to add.

This assumes that the DVR is initiating the uploads from inside the network.
If you're accessing the DVR from some remote location via a NAT pinhole on the router's public IP address, you don't need to do anything special to force uploads in this case - all you need to do is use the desired ISP's public IP address to reach the DVR from outside the network, and the stream will naturally flow back upstream through that same interface.
When given a spoon,
you should not cling to your fork.
The soup will get cold.
 
gableoley
just joined
Topic Author
Posts: 10
Joined: Wed Jun 08, 2016 9:10 pm

Re: two wan redirect a port to one of them from LAN upload only

Fri Jun 24, 2016 12:32 am

Thanks I'll try that :D

Who is online

Users browsing this forum: ruwerra and 29 guests