Configuring a Draytek 2820 Router for 3CX with QoS configuration
In this article we will describe the configuration of a hardware router with a very attractive quality-price ratio. The Draytek 2820 is a ADSL 2/2+ Router/Firewall with advanced features such as the capability to establish 32 VPN connections, a robust object-based firewall, QoS Management, Bandwidth Management, and Dual-WAN cabilities.
We will look into NAT configuration for 3CX and QoS configuration to prioritize SIP and RTP traffic. The firmware version tested was version 3.3.3 dated 23 October 2009.
NAT Configuration
- Browse to the Router’s Web Interface (the device’s default IP Address is 192.168.1.1).
- Go to the “NAT -> Open Ports” menu
- Ensure the “Enable Open Ports” checkbox is enabled
- Set the “Comment” field to “3CX”
- Set the “WAN Interface” field to “WAN1″
- Set the “Local Computer” field to the IP Address of the 3CX PhoneSystem machine (in this example 192.168.1.200)
- Set the first line as follows:
- Set the “Protocol” field to “TCP/UDP”
- Set the “Start Port” and “End Port” fields to “5060″
- Set the second line as follows:
- Set the “Protocol” field to “TCP/UDP”
- Set the “Start Port and “End Port” fields to “5090″
- Set the third line as follows:
- Set the “Protocol” field to “UDP”
- Set the “Start Port” field to “9000″ and the “End Port” field to “9049″
- Set the fourth line as follows:
- Set the “Protocol” field to “UDP”
- Set the “Start Port” field and the “End Port” field to “10000″
- Click on the “OK” button at the bottom of the page.
This will send you back to the “Open Ports” summary page.
QoS Configuration
- Browse to the Router’s Web Interface (the device’s default IP Address is 192.168.1.1).
- Go to the “Bandwidth Management -> Quality of Service” menu
First we need to define the ports and services used by 3CX PhoneSystem. Proceed as follows:
- Click the “Edit” link under the “Service Type” heading.
- Click on “Add”, and insert the following service: Name: “3CX SIP”, Service Type: “TCP/UDP”, Type: “Single”, Port Number: ”5060″
- Click on “Add”, and insert the following service: Name: “3CX Tunnel”, Service Type: “TCP/UDP”, Type: “Single”, Port Number: ”5090″
- Click on “Add”, and insert the following service: Name: “3CX RTP”, Service Type: “UDP”, Type: “Range”, Port Number: ”9000 – 9049″
- Click on “Add”, and insert the following service: Name: “3CX FAX”, Service Type: “UDP”, Type: “Single”, Port Number: ”10000″
- Click the “Cancel” button to go back to the previous page
Now we need to create a “Class Rule”:
- Click on the “Edit” link in the “Class 1″ row under the “Rule” header
- Set the “Name” field to “3CX VOIP”
- Click on the “Add” button
- Set the “ACT” field to Enabled
- Set the “Local Address” field to the IP Address of the PBX Machine (in this example 192.168.1.200)
- Ensure the “Remote Address” field is set to “Any”
- Ensure the “DiffServ Codepoint” field is set to “Any”
- Set the “Service Type” field to “3CX SIP”
- Click the “OK” button
- Repeat the last 6 steps for each of the 3 remaining service types, changing the “Service Type” field to “3CX Tunnel”, “3CX RTP”, and “3CX FAX” respectively.
- Click on the “OK” button to save the Class Rule.
This will take you to the QoS Main Page.
Now we need to instruct the router what priority level to assign to traffic of class “3CX VOIP”.
- Click on the “Setup” link on the “WAN1″ row.
- Set the “Enable the QoS Control” checkbox, and set the traffic direction to “BOTH”
- Set the “Reserved_bandwidth Ratio” field for traffic of class “3CX VOIP” to 70%
- Set the “Reserved_bandwidth Ratio” field for traffic of Class 2 and Class 3 to 10%
- Click on the “OK” button to complete the configuration
Note that the “Reserved_bandwidth Ratio” percentage value does not reserve bandwidth at all times, but only when other traffic types are competing with “3CX VOIP” class traffic for bandwidth.











Comment 9
May 24th, 2010
[...] Follow this link: Configuring a Draytek 2820 Router for 3CX with QoS configuration [...]
May 24th, 2010
Good to see this article, as we have been using Draytek Routers on voice and data networks for many years. The V2820 is a very robust and powerful router that we can thoroughly recommend. It is also notable that this router can give you dual-WAN connection (2 x load-shared ADSL) and alternate connection via GSM USB wireless.
May 24th, 2010
Normal the draytek can be a little messy with it’s sip_alg (most of the times on hosted voip systems) so we always put the settings off.
how?
Quote from the manual:
“> sys sip_alg ? usage: sys sip_alg [value]
0 – disable SIP ALG 1 – enable SIP ALG current SIP ALG is disabled”
May 25th, 2010
[...] 3CX VoIP blog » Configuring a Draytek 2820 Router for 3CX with QoS configuration [...]
May 26th, 2010
[...] Draytek Vigor 2820 http://www.3cx.com/blog/voip-howto/draytek-firewall-voip/ [...]
May 26th, 2010
“Set the “Start Port” field to “5060″ and the “End Port” field to “5090″”
Why are you opening Ports 5060 to 5090? Should it not just be Ports 5060(Sip) & 5090(3CX Tunnel)?
May 27th, 2010
Hi Tonnie
The document assumes that you start off from factory defaults. By default the SIP ALG should start disabled.
It should be left disabled.
However you can manually disable the SIP ALG by logging onto the Draytek using telnet, and issuing the command:
Regards
May 27th, 2010
Hi Brian
Yes, opening only ports 5060 and 5090 would be more accurate – thanks for pointing this out.
I have updated the blog post accordingly.
Regards
May 27th, 2010
For many years, Draytek has been our choice for VoIP routers for many of the same reasons. Some may find this helpful, in your last figure, WAN 1 General Setup, bottom right corner is the option Online Statistics – this is an excellent graphic tool to help you test and verify that your QOS settings are working as planned – or not.