QoS

From FreeSWITCH Wiki

Jump to: navigation, search

Marking your packets with DSCP will enable you to implement a QoS policy on your network to give RTP and SIP traffic more priority. Keep in mind that just because you are marking the packets doesn't mean you have QoS. Your network needs to LOOK at the packets and honor the markings in order for this to work.

#Cherebrum's DSCP marking iptables
iptables -t mangle -A OUTPUT -p udp -m udp --sport 4569 -j DSCP --set-dscp-class ef # mark IAX2 packets with EF
iptables -t mangle -A OUTPUT -p udp -m udp --sport 5060 -j DSCP --set-dscp-class cs3 # mark SIP UDP packets with CS3
iptables -t mangle -A OUTPUT -p tcp --sport 5060 -j DSCP --set-dscp-class cs3 # mark SIP TCP packets with CS3
iptables -t mangle -A OUTPUT -p tcp --sport 5061 -j DSCP --set-dscp-class cs3 # mark SIP TLS packets with CS3
iptables -t mangle -A OUTPUT -p udp -m udp --sport 16384:32767 -j DSCP --set-dscp-class ef # mark RTP packets with EF


#Trixter's SIP rate limiter (This helps protect you from DoS attacks)
iptables -A INPUT -p udp --dport 5060 -m limit --limit 5/s --limit-burst 5 -i eth0 -j REJECT
Personal tools
Community