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. |
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 :) |
Tnx for your reply
Are you sure I need iptables for that ? There is no way doing it without IPtables ? |
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 09:35 AM. |