Routing to a different outgoing interface based on hostname

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Routing to a different outgoing interface based on hostname

Samba - linux mailing list
I might be getting a fast wireless ISP to either complement or replace
my slow ADSL2.  If I'm going to use them to complement each other I
would like to be able to route traffic based on the type of traffic.  
Easy enough to do for different protocols, but I'd like to route, say,
all Windows and iOS updates (over HTTPS) over the unlimited, slow ADSL,
but allow traffic going to the user (YouTube, general browsing, Skype)
to go over the faster interface.

How might I do this robustly?

The best I can think of is to have some process where I try and discover
all the hostnames used for updates, and then interrogate DNS regularly
to turn them into IPv4 addresses, and feed them into iptables.  It
sounds fraught with gradual degradation as servers are reprovisioned
(hostnames change), but also to major degradation if some parsing code
goes wrong.

The second best is sort of time-of-day.  Redirect all after-hours
traffic to the unlimited ADSL2, and hope that most updates are smart
enough to pick an out-of-hours time to update.

Any other suggestions?

Tony

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: Routing to a different outgoing interface based on hostname

Samba - linux mailing list
Just a thought but this sounds a bit like a "quality of service"
problem.
Perhaps you can investigate the "tc" command.
( I saw a suggestion for routing by user)

HTH
Brenton

On Wed, 2017-06-14 at 17:08 +1000, Tony Lewis via linux wrote:

> I might be getting a fast wireless ISP to either complement or replace
> my slow ADSL2.  If I'm going to use them to complement each other I
> would like to be able to route traffic based on the type of traffic.  
> Easy enough to do for different protocols, but I'd like to route, say,
> all Windows and iOS updates (over HTTPS) over the unlimited, slow ADSL,
> but allow traffic going to the user (YouTube, general browsing, Skype)
> to go over the faster interface.
>
> How might I do this robustly?
>
> The best I can think of is to have some process where I try and discover
> all the hostnames used for updates, and then interrogate DNS regularly
> to turn them into IPv4 addresses, and feed them into iptables.  It
> sounds fraught with gradual degradation as servers are reprovisioned
> (hostnames change), but also to major degradation if some parsing code
> goes wrong.
>
> The second best is sort of time-of-day.  Redirect all after-hours
> traffic to the unlimited ADSL2, and hope that most updates are smart
> enough to pick an out-of-hours time to update.
>
> Any other suggestions?
>
> Tony
>


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|

Re: Routing to a different outgoing interface based on hostname

Samba - linux mailing list
On 14/06/17 18:33, Brenton Ross via linux wrote:
> Just a thought but this sounds a bit like a "quality of service"
> problem.
> Perhaps you can investigate the "tc" command.
> ( I saw a suggestion for routing by user)
Thanks Brenton.  I've used tc lightly before, but this is probably
better solved at the routing level rather than at shaping and
prioritising the traffic.

I found some domain names, and found that Netcraft can enumerate
subdomains.  However looking at some traffic flows, Microsoft at least
uses Akamai for content distribution.  I can't imagine that I could
successfully enumerate all those hosts.

I think the easiest way is using time of day.  If I set MS and iOS to
only update overnight, and then set a cron job to change routes before
and after, it might be enough.

Tony

--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux