D
D
Dmitry2016-03-13 23:39:59
linux
Dmitry, 2016-03-13 23:39:59

Is it possible to prioritize VoIP on a linux router?

Hi all!
There is a working network, quite simply arranged - several PCs, and several IP phones. All this is connected through simple SOHO switches to a router, which is a regular PC with linux (CentOS 6.7).
One interface looks to the network, the other directly to the Internet. Has an external routable address. It is also a phone server (asterisk 1.8). The Internet tariff is extremely small - 3Mbps.
Sometimes, accordingly, strange things happen to the voice, especially at the time of network loading.
Question: is it possible to set up prioritization of traffic from asterisk to the VoIP provider in this case? And, accordingly, coming from him.
What methods can be implemented, through tc somehow, or other ways?
How, in general, in theory, should this work?
Do you need to mark traffic in asterisk itself (ToS), or through iptables, or not mark at all, but do a selection by ports and IP, for example?
And further, is it all put in some kind of priority queue, or can you just allocate a guaranteed bandwidth for VoIP?
And, in general, will it work in principle? Or do I need to buy something more sharpened?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kir aka Dober, 2016-03-14
@dobergroup

You need to mark traffic in asterisk itself (ToS), or through iptables,

If I'm not mistaken, asterisk marking worked fine only if it was run as root. However, as on fresh releases - I do not know.
With iptables, everything is very simple:
$IPTABLES -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp-class cs3 # SIP
$IPTABLES -A OUTPUT -t mangle -p tcp -m tcp --dport 5060 -j DSCP --set-dscp-class cs3 #SIP
$IPTABLES -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp-class ef # RTP

But. In fact, the provider's routers in 95% of cases will spit on your marking and rewrite it.
But you can try with such a script, as described here . just fix your lane.

V
Viktor, 2016-03-14
@awsswa59

It is real to set up marking of packages using asterisk. Even sending marked packets to the provider is also real, but ... The provider will cut off all your traffic markings with the very first managed switch.
The best option when your entire channel is clogged is to make queues by traffic and by the user - this is done quite easily. www.awsswa.livejournal.com/10551.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question