I have a cable modem that provides 2 public IPs over dhcp. I currently use 2 routers to obtain two IPs and 2 gateways onto the Internet. This is because the ISP throttles an IP if it detects any form of torrent even after the torrent is closed causing ssh and other protocols to suffer.

I also now have VOIP phones in the home that work much better with QoS enabled.

Is it possible to combine the two routers into one linux box with two ethernet cards:

  1. eth0 WAN - 2 dhcp IPs/gateways (through bridging or macvlan?)
  2. eth1 LAN - 1 private IP providing NAT/Gateway/DNS/etc

    • routing to send one host Torrent traffic through 2nd gateway IP. All other hosts route through the main gateway IP.
    • QoS needs to monitor combined traffic going through both gateways so VOIP doesn't suffer. VOIP suffers when devices upload too much data.


Cable Modem
Linux router with QoS
 WAN IP1 gw
 WAN IP2 gw
   torrent box - should route through WAN IP2.
   voip phone - rest should route through WAN IP1.

What I've learned so far is that this is called a multi-homed setup and macvlan may allow for two dynamic IPs on one interface. Just having troubles getting all the pieces together.

  • Why would you want to restrict yourself to one outward-facing interface when you can easily have two? Just buy yourself a small USB/ethernet adapter (just a few bucks) and you will have three proper interfaces. This will be twice as fast: in your current (proposed) arrangement, you can only have one interface working out ot the two, at any given time, while following my suggestion you can have both exchanging data simultaneously. This is especially beneficial to your VoIP connections. Oct 16 '16 at 8:18
  • And, BTW, having two IPs on one/two interfaces is perfectly fine, provided you instruct your routing table to distinguish which packets go one way, and which go the other way. This is called policy routing or source routing, you can read about it here, blog.scottlowe.org/2013/05/29/… which is a simple introduction. Oct 16 '16 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.