Reply
New Member
Posts: 17
Registered: ‎10-14-2013
Accepted Solution

Edgerouter X and VoIP

Hi,

 

I setup an Edgerouter X the other day and needed to set it up for QoS for the VoIP phones.  When I initially set it up, I used the Basic Wizard so I could change the LAN IP as all of their devices were setup for 192.168.0.x and I could easily put 192.168.0.1 as the LAN IP to the router.  After that, I went into the CLI and input the following:

 

configure
set system conntrack modules sip disable
commit
save
exit

configure
# Set-up the details of the DownStream Policy
set traffic-policy shaper DownStream description "DownStream QoS policy"
set traffic-policy shaper DownStream bandwidth 52000kbit
set traffic-policy shaper DownStream class 10 description "RTP"
set traffic-policy shaper DownStream class 10 bandwidth 25%
set traffic-policy shaper DownStream class 10 ceiling 100%
set traffic-policy shaper DownStream class 10 match VOIP-RTP ip dscp 46
set traffic-policy shaper DownStream class 20 description "SIP"
set traffic-policy shaper DownStream class 20 bandwidth 5%
set traffic-policy shaper DownStream class 20 ceiling 100%
set traffic-policy shaper DownStream class 20 match VOIP-SIP ip dscp 24
set traffic-policy shaper DownStream default bandwidth 70%
set traffic-policy shaper DownStream default ceiling 100%

# Set-up the details of the UpStream Policy
set traffic-policy shaper UpStream description "UpStream QoS policy"
set traffic-policy shaper UpStream bandwidth 11000kbit
set traffic-policy shaper UpStream class 10 description "RTP"
set traffic-policy shaper UpStream class 10 bandwidth 50%
set traffic-policy shaper UpStream class 10 ceiling 100%
set traffic-policy shaper UpStream class 10 match VOIP-RTP ip dscp 46
set traffic-policy shaper UpStream class 20 description "SIP"
set traffic-policy shaper UpStream class 20 bandwidth 5%
set traffic-policy shaper UpStream class 20 ceiling 100%
set traffic-policy shaper UpStream class 20 match VOIP-SIP ip dscp 24
set traffic-policy shaper UpStream default bandwidth 45%
set traffic-policy shaper UpStream default ceiling 100%

# Apply the policies to the interfaces (this example has eth0 is WAN, eth2 LAN)
set interfaces ethernet eth0 traffic-policy out DownStream
set interfaces ethernet eth2 traffic-policy out UpStream
# Commit, Save, and Exit
commit
save
exit

 

The modem is plugged into eth0 and the network switch is plugged into eth2.

 

After I reboot the router, I can't connect back to the device and DHCP is no longer working.  I have to reset the Edgerouter and go through the basic wizard again.  I know that I'm doing something wrong here.  Can you please tell me where I'm wrong?  Thanks in advance for your help!

 

Matt


Accepted Solutions
Veteran Member
Posts: 6,056
Registered: ‎03-24-2016
Kudos: 1594
Solutions: 684

Re: Edgerouter X and VoIP

[ Edited ]

@kendalltechwrote:

# Apply the policies to the interfaces (this example has eth0 is WAN, eth2 LAN)
set interfaces ethernet eth0 traffic-policy out DownStream
set interfaces ethernet eth2 traffic-policy out UpStream

At second glance, you have up and down also reversed. try:

Spoiler
# Apply the policies to the interfaces (this example has eth0 is WAN, eth2 LAN)
set interfaces switch switch0 traffic-policy out DownStream
set interfaces ethernet eth0 traffic-policy out UpStream

As you're not using LAN IP addresses, you can do both up and download shaping on eth0 using ifb device:

Spoiler
set interfaces ethernet eth0 redirect ifb0
set interfaces input ifb0 traffic-policy out DownStream
set interfaces ethernet eth0 traffic-policy out UpStream

Make sure packets received from internet have those DSCP markings, some ISPs reset them to zero

 

@Joyn:

Never do QoS on eth port used under switch0.  This config is invalid, and on next reboot, all ports are pulled from switch, rendering device inaccessible.

 

You can apply QoS policy to L3 subinterface, like

<Edit: changed switch0 to eth0>

set interfaces ethernet eth0 vif 100 traffic-policy out DownStream

(at least in theory. Last time I tried, I got so many retransmits, download speed ended up at 15% of configured speed)

 

Advantage of QoS on switch0 itself:  Now you have single interface for download, and seperate VLANs can borrow amongst each other.  So WiFi guest network comes last

 

View solution in original post


All Replies
Veteran Member
Posts: 6,056
Registered: ‎03-24-2016
Kudos: 1594
Solutions: 684

Re: Edgerouter X and VoIP

See:

https://community.ubnt.com/t5/EdgeRouter/Known-Issues-of-EdgeMax-Series/m-p/1859460#M153239

 

QoS rules should go onto L3 interface switch0, not onto eth port being a switch0 member

 

New Member
Posts: 17
Registered: ‎10-14-2013

Re: Edgerouter X and VoIP

Thanks for your quick reply! That makes sense to me. So, the rules should be applied to only one eth port and not a grouped together set of ports. Can you please let me know what I should change in the code to make that happen? Thanks so much!
Highlighted
Regular Member
Posts: 628
Registered: ‎07-23-2015
Kudos: 390
Solutions: 31

Re: Edgerouter X and VoIP

@16again: Does this apply to L3 ports with dot1q VLAN termination as well? Should we not apply QoS to the underlying physical port and only apply them to the VIFs?
Please don't forget to kudo helpful posts and mark accepted solutions accordingly!
jcm.me - Personal Site | Joyn.Tech - Consulting Site

Add Auto-Provisioning Support to UNMS
Veteran Member
Posts: 6,056
Registered: ‎03-24-2016
Kudos: 1594
Solutions: 684

Re: Edgerouter X and VoIP

[ Edited ]

@kendalltechwrote:

# Apply the policies to the interfaces (this example has eth0 is WAN, eth2 LAN)
set interfaces ethernet eth0 traffic-policy out DownStream
set interfaces ethernet eth2 traffic-policy out UpStream

At second glance, you have up and down also reversed. try:

Spoiler
# Apply the policies to the interfaces (this example has eth0 is WAN, eth2 LAN)
set interfaces switch switch0 traffic-policy out DownStream
set interfaces ethernet eth0 traffic-policy out UpStream

As you're not using LAN IP addresses, you can do both up and download shaping on eth0 using ifb device:

Spoiler
set interfaces ethernet eth0 redirect ifb0
set interfaces input ifb0 traffic-policy out DownStream
set interfaces ethernet eth0 traffic-policy out UpStream

Make sure packets received from internet have those DSCP markings, some ISPs reset them to zero

 

@Joyn:

Never do QoS on eth port used under switch0.  This config is invalid, and on next reboot, all ports are pulled from switch, rendering device inaccessible.

 

You can apply QoS policy to L3 subinterface, like

<Edit: changed switch0 to eth0>

set interfaces ethernet eth0 vif 100 traffic-policy out DownStream

(at least in theory. Last time I tried, I got so many retransmits, download speed ended up at 15% of configured speed)

 

Advantage of QoS on switch0 itself:  Now you have single interface for download, and seperate VLANs can borrow amongst each other.  So WiFi guest network comes last

 

Regular Member
Posts: 628
Registered: ‎07-23-2015
Kudos: 390
Solutions: 31

Re: Edgerouter X and VoIP

What about in the case of not using L2 interfaces under switch0 but using VIFs on an L3 interface? Should you apply the QoS on the physical interface or the VIF?

Please don't forget to kudo helpful posts and mark accepted solutions accordingly!
jcm.me - Personal Site | Joyn.Tech - Consulting Site

Add Auto-Provisioning Support to UNMS
Veteran Member
Posts: 6,056
Registered: ‎03-24-2016
Kudos: 1594
Solutions: 684

Re: Edgerouter X and VoIP

Joyn,

I did ran into trouble assigning QoS policy to eth0 vif 200, not a switch port.  (just edited previous post)

 

QoS on parent interface or VLAN underneath:  On parent, vlan tag is included, this reduces throughput for fixed speed setting a very small amount.

 

note about inner switch workings:

If you add a vlan under switch0, vlan tagging is done by switch hardware

If you pull an eth port from the switch, under the hood, it's put onto high numbered reserved vlan, like 409x.

If you add vlan to an eth port, tagging is done by CPU, not the switch!

 

use dump commands on /sbin/switch  to see those internal VLANs

 

 

 

New Member
Posts: 17
Registered: ‎10-14-2013

Re: Edgerouter X and VoIP

@16again Thanks!  That fixed it!  I'm not surprised I had LAN and WAN reversed.  I was pulling an all nighter when I put that together and I'm getting too old for all nighters.  I know excuses...excuses...  Have a nice day! 

Reply