Hello Guys,
First of all I am sorry if I posted this question in the wrong place as I don’t know where exactly to post it.
I have routerboard 951Ui-2HnD and I am using it to merge two internet lines wan1 and wan2 and it’s working fine but I am facing a problem when I am trying to connect to any FTP server or cPanel ( i am a web developer ) because of the 2 ips it’s forces me to logout every 15 seconds as security measure.
I need to force any FTP ( port 21 ) connection to be using a single wan ( let’s say wan1 ) and some wild card websites to do the same. for example I want any SSL ( port 443 ) connection to *.siteground.com use single wan also.
I hope I explained the problem correctly as I searched for days and I can’t find anything … and I assume I am searching wrong.
I think Per-Connection-Classifier (PCC) is what you need. It’ll try to track connections (from same src-addr and dest-addr) and route them over the same wan.
To export config, run “/export hide-sensitive” in terminal and it will be printed out. Or “/export hide-sensitive file=myconfig” and it will be saved in file myconfig.rsc, accessible under Files. Additionally, if you don’t want to share your addresses with the whole world, you can censor them. But be careful to not overdo it (config with xxx.xxx.xxx.xxx everywhere does not tell much).
You should be able to force connections to selected addresses to go through only one WAN, if you add new mangle rule above current connection marking rules and add connection-mark=no-mark to those:
Unfortunately, it’s not a magic solution for all your problems.
Ftp with its multi-connection model is tricky. From my limited local testing, it looks like data connections (identified as related) inherit connection mark from control connection. That’s the good part. The bad is that related connections can only be identified for ftp on standard port 21 (unless you add another in /ip firewall service-port; but you can’t add all). Even worse, connection must be unencrypted. If you use encryption (which is very good idea), data connections can’t be identified as related. You could probably watch for connections to port 21, add destination address to temporary list and then route all other connections to this address using same WAN. But if the same address runs another service (e.g. http), it would catch all those connections too.
Matching based on hostnames is another tricky part. Firewall itself can’t do it. It could be done for specific hostnames, if you resolved them using script and added results in address list, and then used this list as shown at beginning of this post. I don’t see this solution as very elegant one, but it would work. But I don’t think there’s a way how to do it for *.domain.tld.