Hello,

I've been trying to make my own Debian router at home to make use of my 2 dsl connections.

What i would like to achieve is to make all normal traffic go through my first dsl isp (let's call it isp-1), and for torrenting (transmission) and newsgroups (sabnzbd) to go through isp-2.

Both ISP are in gateway mode, meaning i can use my public ip directly on my router.

The machine has 3 Ethernet NIC and 1 wireless.

Here is my interfaces configurations :

Code:
# ISP-1
allow-hotplug eth2
iface eth2 inet static
        address 128.128.128.144
        netmask 255.255.252.0
        post-up /sbin/ip rule add from 128.128.128.144/32 table isp1
        post-up /sbin/ip rule add to 128.128.128.144/32 table isp1
        post-up /sbin/ip route add 128.128.128.0/22 dev eth2 src 128.128.128.144 table isp1
        post-up /sbin/ip route add default via 128.128.128.254 dev eth2 table isp1
        post-down /sbin/ip rule del from 128.128.128.144 table isp1


# ISP-2
allow-hotplug eth0
iface eth0 inet static
        address 128.128.128.94
        netmask 255.255.252.0
        post-up /sbin/ip rule add from 128.128.128.94/32 table isp2
        post-up /sbin/ip rule add to 128.128.128.94/32 table isp2
        post-up /sbin/ip route add 128.128.128.0/22 dev eth0 src 128.128.128.94 table isp2
        post-up /sbin/ip route add default via 128.128.128.254 dev eth0 table isp2
        post-up /sbin/ip route add default scope global metric 1 nexthop via 128.128.128.254 dev eth0
        post-down /sbin/ip rule del from 128.128.128.94 table isp2

# LAN
allow-hotplug eth1
iface eth1 inet manual

# WIFI
allow-hotplug wlan0
iface wlan0 inet manual

# BRIDGE LAN/WIFI
auto br0
iface br0 inet static
        bridge_ports eth1 wlan0
        address 192.168.0.40
        netmask 255.255.255.0
        dns-nameservers 127.0.0.1
My iptables :

Code:
iptables -t filter -A FORWARD -i eth0 -j ACCEPT
iptables -t filter -A FORWARD -o eth0 -j ACCEPT
iptables -t filter -A FORWARD -o br0 -j ACCEPT
iptables -t filter -A FORWARD -i br0 -j ACCEPT
iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -I FORWARD -i br0 -o eth0 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 51413 -j DNAT --to 192.168.0.40:51413
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 51413 -j DNAT --to 192.168.0.40:51413
The port 51413 is the port transmission is listening to, it is working well on eth0 (ISP-2).

For now, nothing go through eth2 (ISP-1), and 192.168.0.40 is my gateway for all LAN clients.

Transmission and sabnzbd are hosted on the router.


I have no clue how to achieve this, or even if this is possible.

Any advice would be very appreciated.

Thanks.