Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

my setup

I have 2 ISP connexion : ADSL and SDSL. A qos (named qos, ip : server stands before the ADSL router. It is the only way to access the ADSL gateway (
through a bridge (br0). so this qos server is invisible and can easily be unplugged if it fails.

As for now, the default gateway of all LAN computers is, and so all traffic pass through the qos.

This setup work very well.

my need

Now, I need to route a defined service (isl) (already marked by iptable for the qos purpose) to the SDSL ( gateway.

I can achieve that by creating another route table named «isl» and create the default gateway pointing to the SDSL router.

after that, I create a rule that

grep "30 isl" /etc/iproute2/rt_tables || echo "30 isl" >> /etc/iproute2/rt_tables
ip route add default via dev br0 table isl
ip rule add fwmark 0x1e table isl

with this setup, I work if I change all default gateway to

my question

how to force these routing table to apply even if the hosts don't have my qos server as gateway, but always the ADSL router

my thought was to use some iptables rules to NAT all marked packet to local host, which will then redirect traffic to SDSL, but I feel wrong with that.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.