Use a specific interface for specific traffic

Two internet providers are connected to my NethServer.
A task:
Users of the local network need to go to the website through one provider, and to the website through another. How can this be implemented on NethServer?

Is it even possible to implement on NethServer?


welcome to Nethserver Community.

Yes, that’s possible with multi-wan and firewall rules.

Well thank you.
But how to do this in my example?
I beg for help, since I tried all the options. Besides, I think someone will come in handy too.

You need to know all the IP addresses corresponding to and
Then set the rules, which are based on IP Addresses and not DNS entries.

yes I understand this. But none of my rules work.
For example, there is a site “”.
Its IP address is I create a firewall rule with parameters:
Action - route to “provider 2”
Source - role green
Destination - host
Service - Any
But when I go to this site - it shows my ip-address from the “provider 1”.
Maybe I should still perform some actions?
Please help sort it out. I am new to NethServer, but far from new to networks.

Guys, any idea?
I still cant solve the problem.

If the proxy is enabled, this rule must be set by proxy rules.

Proxy disabled. Never even turned on.
What else could be the problem?

It looks like a firewall is working.
If I change the Action to “DROP” - no one can access the site.
When I switch back to “Route to …” - all traffic routes through one provider.
And it doesn’t matter which provider is listed in the rule.

In the Terminal, run shorewall show mangle | grep
It should output something like:

    0     0 MARK       all  --  ens35  *           /* RULE#41 */ MARK set 0x10000

where ens35 is your green interface and 0x10000 the marker for your wan (look in /etc/shorewall/providers).

Also db fwrules show 41 where 41 is the RULE# from above.