* IP TOS based routing
@ 2003-03-25 8:51 Simone Leggio
2003-03-26 12:16 ` Kim Jensen
0 siblings, 1 reply; 7+ messages in thread
From: Simone Leggio @ 2003-03-25 8:51 UTC (permalink / raw)
To: netfilter
Hi all,
I have to send prioritised traffic from host A to host B.
The priority 1 is identified by an IP TOS value of, say 46.
The priority 2 is identified by an IP TOS value of, say 26.
In my network topology, there are two possible routes from host A to
host B, one through host A's network interface eth0 and the other one
through eth1.
I'd like to know whether it is possible, and if so how, with traffic
control to set filters so that packets with TOS 46 are sent to host B
via eth0 and packets with TOS 26 via eth1.
Note that the destination address for all the packets is the same, what
I need is just to route through different interfaces to the same
destination.
Thank you.
Simone.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: IP TOS based routing
2003-03-25 8:51 IP TOS based routing Simone Leggio
@ 2003-03-26 12:16 ` Kim Jensen
2003-03-27 7:32 ` Simone Leggio
2003-04-01 19:36 ` Matthew G. Marsh
0 siblings, 2 replies; 7+ messages in thread
From: Kim Jensen @ 2003-03-26 12:16 UTC (permalink / raw)
To: Simone Leggio, netfilter
On Tuesday 25 March 2003 09:51, Simone Leggio wrote:
> Hi all,
>
> I have to send prioritised traffic from host A to host B.
>
> The priority 1 is identified by an IP TOS value of, say 46.
> The priority 2 is identified by an IP TOS value of, say 26.
>
> In my network topology, there are two possible routes from host A to
> host B, one through host A's network interface eth0 and the other one
> through eth1.
>
> I'd like to know whether it is possible, and if so how, with traffic
> control to set filters so that packets with TOS 46 are sent to host B
> via eth0 and packets with TOS 26 via eth1.
>
> Note that the destination address for all the packets is the same, what
> I need is just to route through different interfaces to the same
> destination.
>
Hi Simone,
Try to use the mangle table to mark your packets which match a specific TOS,
and then add a second routing table with the alternative default connection.
That should work. You can find more info on:
http://linux-ip.net/html/adv-multi-internet.html
http://www.ssi.bg/~ja/nano.txt
/Kim
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: IP TOS based routing
2003-03-26 12:16 ` Kim Jensen
@ 2003-03-27 7:32 ` Simone Leggio
2003-03-27 14:24 ` Rinse Kloek
2003-03-27 14:32 ` Kim Jensen
2003-04-01 19:36 ` Matthew G. Marsh
1 sibling, 2 replies; 7+ messages in thread
From: Simone Leggio @ 2003-03-27 7:32 UTC (permalink / raw)
To: Kim Jensen; +Cc: netfilter
Kim Jensen wrote:
> On Tuesday 25 March 2003 09:51, Simone Leggio wrote:
>>I'd like to know whether it is possible, and if so how, with traffic
>>control to set filters so that packets with TOS 46 are sent to host B
>>via eth0 and packets with TOS 26 via eth1.
>
> Hi Simone,
>
> Try to use the mangle table to mark your packets which match a
specific TOS,
> and then add a second routing table with the alternative default
connection.
> That should work. You can find more info on:
>
> http://linux-ip.net/html/adv-multi-internet.html
> http://www.ssi.bg/~ja/nano.txt
>
> /Kim
Hi Kim,
thanks for the answer.
At the moment I have a test network where I send traffic from host A to
host B generating it with a proper traffic generator (for example MGEN),
which allows also to set the DS (or IP TOS) field.
Does iptables understand the value set before with the traffic generator
or I have to set the field with the mangle table?
What I was thinking to type to discriminate the output interface was:
iptables -A FORWARD -p tcp -m tos --tos TOS -o INTERFACE -j ACCEPT
With TOS equal to the value set by the traffic generator. Would it work?
Simone.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: IP TOS based routing
2003-03-27 7:32 ` Simone Leggio
@ 2003-03-27 14:24 ` Rinse Kloek
2003-03-27 15:33 ` Simone Leggio
2003-03-27 14:32 ` Kim Jensen
1 sibling, 1 reply; 7+ messages in thread
From: Rinse Kloek @ 2003-03-27 14:24 UTC (permalink / raw)
To: Simone Leggio, Kim Jensen; +Cc: netfilter
Hello,
I have a problem like this. Can somebody tell me how I can use 'ip route'
to do DSCP field based routing. I now can only use the TOS fields, but I
want to use the DS fields too.
How Come?
Regards Rinse
----- Original Message -----
From: "Simone Leggio" <simone.leggio@cs.helsinki.fi>
To: "Kim Jensen" <kimj@dawn.dk>
Cc: <netfilter@lists.netfilter.org>
Sent: Thursday, March 27, 2003 8:32 AM
Subject: Re: IP TOS based routing
> Kim Jensen wrote:
> > On Tuesday 25 March 2003 09:51, Simone Leggio wrote:
>
> >>I'd like to know whether it is possible, and if so how, with traffic
> >>control to set filters so that packets with TOS 46 are sent to host B
> >>via eth0 and packets with TOS 26 via eth1.
>
> >
> > Hi Simone,
> >
> > Try to use the mangle table to mark your packets which match a
> specific TOS,
> > and then add a second routing table with the alternative default
> connection.
> > That should work. You can find more info on:
> >
> > http://linux-ip.net/html/adv-multi-internet.html
> > http://www.ssi.bg/~ja/nano.txt
> >
> > /Kim
>
> Hi Kim,
>
> thanks for the answer.
> At the moment I have a test network where I send traffic from host A to
> host B generating it with a proper traffic generator (for example MGEN),
> which allows also to set the DS (or IP TOS) field.
> Does iptables understand the value set before with the traffic generator
> or I have to set the field with the mangle table?
> What I was thinking to type to discriminate the output interface was:
>
> iptables -A FORWARD -p tcp -m tos --tos TOS -o INTERFACE -j ACCEPT
>
> With TOS equal to the value set by the traffic generator. Would it work?
>
> Simone.
>
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: IP TOS based routing
2003-03-27 7:32 ` Simone Leggio
2003-03-27 14:24 ` Rinse Kloek
@ 2003-03-27 14:32 ` Kim Jensen
1 sibling, 0 replies; 7+ messages in thread
From: Kim Jensen @ 2003-03-27 14:32 UTC (permalink / raw)
To: Simone Leggio; +Cc: netfilter
On Thursday 27 March 2003 08:32, Simone Leggio wrote:
> At the moment I have a test network where I send traffic from host A to
> host B generating it with a proper traffic generator (for example MGEN),
> which allows also to set the DS (or IP TOS) field.
> Does iptables understand the value set before with the traffic generator
> or I have to set the field with the mangle table?
> What I was thinking to type to discriminate the output interface was:
>
> iptables -A FORWARD -p tcp -m tos --tos TOS -o INTERFACE -j ACCEPT
>
> With TOS equal to the value set by the traffic generator. Would it work?
>
Hi Simone,
Ensure that you have one routing table for each interface, then use the
command:
$ip rule add fwmark x table y
Then add a mangle entry in your prerouting table, which looks at the tos you
wish to match:
$iptables -t mangle -A PREROUTING -p tcp -m tos --tos TOS -j MARK --set-mark x
That should hopefully do it. The script for copying your routing table is
available in the link: http://linux-ip.net/html/adv-multi-internet.html.
hope this helps
/Kim
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: IP TOS based routing
2003-03-27 14:24 ` Rinse Kloek
@ 2003-03-27 15:33 ` Simone Leggio
0 siblings, 0 replies; 7+ messages in thread
From: Simone Leggio @ 2003-03-27 15:33 UTC (permalink / raw)
To: Rinse Kloek; +Cc: netfilter
Rinse Kloek wrote:
> Hello,
>
> I have a problem like this. Can somebody tell me how I can use 'ip
route'
> to do DSCP field based routing. I now can only use the TOS fields, but I
> want to use the DS fields too.
>
> How Come?
>
> Regards Rinse
The DS field is a TOS field "masked", so the use is pretty similar.
Only, pay attention because the coding is slightly different.
I suggest to take a look to Linux traffix control tool howto:
http://lartc.org/
It is very well specified how to play with differentiated services, and
thus with the DS field.
It is not stirctly related to routing, but it might give you an idea
about the coding.
With regard to routing, I'm working on it too, so unfortunely I cannot
help you so much.
Simone.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: IP TOS based routing
2003-03-26 12:16 ` Kim Jensen
2003-03-27 7:32 ` Simone Leggio
@ 2003-04-01 19:36 ` Matthew G. Marsh
1 sibling, 0 replies; 7+ messages in thread
From: Matthew G. Marsh @ 2003-04-01 19:36 UTC (permalink / raw)
To: Kim Jensen; +Cc: Simone Leggio, netfilter
On Wed, 26 Mar 2003, Kim Jensen wrote:
> On Tuesday 25 March 2003 09:51, Simone Leggio wrote:
> > Hi all,
> >
> > I have to send prioritised traffic from host A to host B.
> >
> > The priority 1 is identified by an IP TOS value of, say 46.
> > The priority 2 is identified by an IP TOS value of, say 26.
> >
> > In my network topology, there are two possible routes from host A to
> > host B, one through host A's network interface eth0 and the other one
> > through eth1.
> >
> > I'd like to know whether it is possible, and if so how, with traffic
> > control to set filters so that packets with TOS 46 are sent to host B
> > via eth0 and packets with TOS 26 via eth1.
ip route add default tos 0x46 dev eth0
ip route add default tos 0x26 dev eth1
Assuming that your TOS values are in Hex. Note also that this will only
work for local hop (direct connect) packets. In order to route the TOS
then you use:
ip route add default tos 0x46 via 1.1.1.1 src 2.2.2.2
with appropriate IP addrs.
> > Note that the destination address for all the packets is the same, what
> > I need is just to route through different interfaces to the same
> > destination.
> >
> Hi Simone,
>
> Try to use the mangle table to mark your packets which match a specific TOS,
> and then add a second routing table with the alternative default connection.
> That should work. You can find more info on:
>
> http://linux-ip.net/html/adv-multi-internet.html
> http://www.ssi.bg/~ja/nano.txt
>
> /Kim
>
>
--------------------------------------------------
Matthew G. Marsh, President
Paktronix Systems LLC
1506 North 59th Street
Omaha NE 68104
Phone: (402) 553-2288
Email: mgm@paktronix.com
WWW: http://www.paktronix.com
--------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-04-01 19:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-25 8:51 IP TOS based routing Simone Leggio
2003-03-26 12:16 ` Kim Jensen
2003-03-27 7:32 ` Simone Leggio
2003-03-27 14:24 ` Rinse Kloek
2003-03-27 15:33 ` Simone Leggio
2003-03-27 14:32 ` Kim Jensen
2003-04-01 19:36 ` Matthew G. Marsh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.