TOS problem


Is tos=0xB8 broken in Asterisk ?

I can use, for example, tos=0x18 and the RTP packets show a DS value of 0x18 and a DSCP of 0x06 which is correct. (11000 vs 110 binary)

HOWEVER, when I specify tos=0xB8, all of the Ds values are set to 0x00


If you are running Asterisk as a non-root user then you don’t have sufficient permission to set the TOS or DSCP bits.

You will need to use iptables to set them yourself.

See here for more information: … k+non-root

Thanks for the reply:

I’m running safe_asterisk as root (however daughter processes run as asterisk) so you may be right.

Now I’m puzzled as to why I can set the ToS and DSCP at all - I can set, and ethereal shows, that the * server is sending out packets signed with 0x10 or 0x18 (all the original settings for high througput or lowdelay etc) but if I try to set TOS directly to DSCP EF (ie ToS 0xb8) I get 0x00 in the tcp packets…


Well, the commands below do set DSCP to EF from the command prompt and I don’t need to worry about trying to get * to do it at all. Thanks for the gentle nudge, gsiemon.

iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28

iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28