Skip to contentSkip to conversation

iptables + ROUTE

DISCUSSION Mato Vidovic 3 participants 3 messages Nov 9, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

I am new in iptables world - and after reading many discussions and studying iptables manpages etc. I am still missing a piece of puzzle to solve the following problem.
I have a need to perform TOS based traffic routing.
That means I have two interfaces (say eth0 and eth1) to backbone and I need to route the real-time critical IP traffic over eth1 and the remaining IP traffic over eth0.
After a lot of experimenting I came to the conclusion that something like the following would do:

# iptables -t mangle -A POSTROUTING -m tos --tos  16 -j ROUTE --oif eth1 
# iptables -t mangle -A POSTROUTING -m tos --tos !16 -j ROUTE --oif eth0 

Unfortunately the Linux box says:
"No chain/target/match by that name"

The kernel I use is 2.6.18, iptables version is the last debian stable version 1.2.11.

Any idea what is wrong here (am I missing something in the configuration, or a library, or am I completely wrong maybe…)?

Thanks for any help.

Br.
Mato

Signature · 2 lines
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
#1 lore raw

Hi,

I am not sure, but you are probably missing the extra module from patch-o-matic-ng...

http://www.netfilter.org/projects/patch-o-matic/pom-extra.html#pom-extra-ROU
TE

E:S

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mato Vidovic
Sent: Donnerstag, 09. November 2006 06:41
To: [email protected]
Subject: iptables + ROUTE

Hi,

I am new in iptables world - and after reading many discussions and studying iptables manpages etc. I am
still missing a piece of puzzle to solve the following problem. I have a need to perform TOS based traffic routing.
That means I have two interfaces (say eth0 and eth1) to backbone and I need to route the real-time critical
IP traffic over eth1 and the remaining IP traffic over eth0. After a lot of experimenting I came to the conclusion that something like the following would do:

# iptables -t mangle -A POSTROUTING -m tos --tos  16 -j ROUTE --oif eth1 
# iptables -t mangle -A POSTROUTING -m tos --tos !16 -j ROUTE --oif eth0 

Unfortunately the Linux box says:
"No chain/target/match by that name"

The kernel I use is 2.6.18, iptables version is the last debian stable version 1.2.11.

Any idea what is wrong here (am I missing something in the configuration, or a library, or am I completely wrong maybe.)?

Thanks for any help.

Br.
Mato

Signature · 2 lines
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
#2 lore raw
In reply to Mato Vidovic

Hello,

Quoted 6 lines · Mato Vidovic

I have a need to perform TOS based traffic routing. That means I have two interfaces (say eth0 and eth1) to backbone
and I need to route the real-time critical IP traffic over eth1 and the remaining IP traffic over eth0. After a lot of experimenting I came to the conclusion that something like the following would do:

# iptables -t mangle -A POSTROUTING -m tos --tos  16 -j ROUTE --oif eth1 # iptables -t mangle -A POSTROUTING -m tos --tos !16 -j ROUTE --oif eth0 

Why not just use the TOS selection feature in advanced routing (involving routing rules and alternate routing tables) ? Something like :

ip rule add tos 16 lookup tos16 priority 100
ip route add default dev eth1 table tos16

Quoted 7 lines

Unfortunately the Linux box says: "No chain/target/match by that name"

The kernel I use is 2.6.18, iptables version is the last debian stable version 1.2.11.

Any idea what is wrong here (am I missing something in the configuration, or a library, or am I completely wrong maybe...)?

As Edvin Seferovic wrote, the kernel part of the ROUTE target is not included in the mainstream kernel yet. You can add it to your kernel source tree with the patch-o-matic-ng a build a ROUTE-capable kernel.