LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to set TOS bits on LINUX ethernet interface (http://www.linuxquestions.org/questions/linux-networking-3/how-to-set-tos-bits-on-linux-ethernet-interface-150656/)

markraem 02-26-2004 04:21 AM

How to set TOS bits on LINUX ethernet interface
 
How can I configure TOS bits ( or IP precendence bits) on an ethernet interface of linux (Red Hat) ?

Can I configure this on a per ethernet interface basis ?

Tnx.

Oliv' 02-26-2004 07:23 AM

To do that you need iptables. The table of TOS is the following:
HEXA BINAIRE DECIMAL SIGNIFICATION
0x10 1000 8 Minimize Delay
0x08 0100 4 Maximize throughput
0x04 0010 2 Maximize reliability
0x02 0001 1 Minimize monetary cost
0x00 0000 0 Normal

and here is an example of the rules to use to add TOS in packets:
iptables -A PREROUTING -t mangle -p tcp --sport ssh -j TOS --set-tos Minimize-Delay
iptables -A PREROUTING -t mangle -p tcp --sport ftp -j TOS --set-tos Minimize-Delay
iptables -A PREROUTING -t mangle -p tcp --sport ftp-data -j TOS --set-tos Maximize-Throughput

Hope this help you :)

markraem 02-26-2004 08:01 AM

Tnx for your reply

Are you sure I need iptables for that ?

There is no way doing it without IPtables ?

Oliv' 02-26-2004 08:11 AM

Maybe there's a way to do it without iptables but I don't know it... Each time I've done QoS on Linux I have used tools like iptable or tc.
Now another way is to do your own program to modify TOS bits in packets :)


All times are GMT -5. The time now is 10:27 AM.