How to use QoS with OpenVPN client / PBR?

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2
Author Message
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Wed Aug 28, 2019 18:36    Post subject: Reply with quote
A VPN is a network within a network.

A VPN service usually creates a tunnel.

The network doesn't have to BE a tunnel.

Unless it is DSL. VPN would then create
a tunnel in that tunnel. Some ISP's
don't support VPN over DSL.

Cable internet usually does.
Sponsor
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Wed Aug 28, 2019 19:03    Post subject: Reply with quote
eugene1973 wrote:
Did the ISP give you the dd-wrt box
to use on their service?

If not you may want to restore factory defaults without that script fix.

No, it's my router. And that line does not come from the script. It's in the route table created by dd-wrt.

My vpn setup is vanilla NordVPN with PBR plus, in the openvpn client config, several "remote" lines with "remote-random" so that I draw a server out of a hat. Nothing exotic at all, and it's worked for a year or so. In fact it's worked great with the script tweaking local access for many months. The script doesn't change any route-table lines. (I don't use anyone's script without careful analysis and testing.) It just copies them from one table to the other. No biggie.

I suspect you are overthinking the questions of gateways and tunnels here. Nothing special is going on. It's an ordinary simple ISP setup with a cable modem. The vpn system builds a tunnel through the wan and isp to the nordvpn server. There is no tunnel within a tunnel here. The ISP connection is not some funky tunnel.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Wed Aug 28, 2019 19:16    Post subject: Reply with quote
egc wrote:
@SurprisedItWorks, to clarify some things...

Thanks, egc. I appreciate the nuggets there.

Looks like the thing for me to do, re the original question, is to update to a new build and in QoS set Port to LAN&WLAN so I can attempt to set priorities at the interface level. I'll go with the HTB and Cake unless I hear a good reason to go a different way. Then I can try setting priorities at the interface level. Looks like I just keep SFE off for now. (Have never used it anyway, because of the PBR issue.)

I guess I'll find out, at least as far as implied by the menus on the QoS page, whether I have independent control of priorities for tun1 and for the interfaces that feed it.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12885
Location: Netherlands

PostPosted: Wed Aug 28, 2019 19:18    Post subject: Reply with quote
Sounds good Smile
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Wed Aug 28, 2019 19:22    Post subject: Reply with quote
In my experience a separate tunnel is created in VPN services. I see you have a tunnel. Take windows VPN for instance. It creates a tunnel on the fly. Since we are talking dd-wrt it will create a more permanent tunnel. Normally though the tunnel is not the interface the gateway resides on. But I haven't tried dd-wrt VPN before.

The scope of your IP addresses and routes plays a part in QOS.

Which QOS values do you use?
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Wed Aug 28, 2019 19:34    Post subject: Reply with quote
Best effort
Expedited forwarding
Assured forwarding
Network controlled

Are the usual names for cos/QOS

If your interface on the wan port of the
dd-wrt box is using QOS it might wig
out if the other side of that cable,
the one that goes to the cable modem.
Because it might be using best effort.

You need to get use of assured forwarding
on the cable modem side. If you can't
you must match assured forwarding as
close as possible in dd-wrt. Check to
find out which QOS values match assured
forwarding the best.

I haven't figured it out yet.

I think.

But if it drops the internet it is a scope
problem. QOS should not ever drop. If
your network is right.
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Wed Aug 28, 2019 19:37    Post subject: Reply with quote
I have not checked if dd-wrt uses drop
files. That is a must.

I got the same problem before but I use
dd-wrt boxes as AP's.

I got a gateway between the cable modem
and the dd-wrt boxes.
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Wed Aug 28, 2019 19:39    Post subject: Reply with quote
Hey @eugene1973, those sound like issues for the implementer of dd-wrt to sort out, not me. I gather there's been a recent burst of effort on QoS at the dd-wrt implementation level, so for now I'm just going to assume they know what they are doing and try it out (over the weekend). Certainly the categories of QoS effort you mention do not appear on the QoS config page in dd-wrt.
_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Wed Aug 28, 2019 19:42    Post subject: Reply with quote
Here's what I use

QoS Settings

Start QoSEnable Disable

Port lan/wlan

Packet Scheduler HFSC

Queueing Discipline Codel

Downlink (kbps) 221576

Uplink (kbps) 57646

This should work fine alone.
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Wed Aug 28, 2019 20:24    Post subject: Reply with quote
Tcp congestion control

= Westwood
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Mon Sep 02, 2019 15:09    Post subject: Reply with quote
egc wrote:
...as far as I know QoS will not work on downstream with SFE turned on (I am not even sure SFE stays on if you enable QoS in earlier builds it was disabled when QoS was turned on, so check with lsmod Smile.

I'm on 40784 now and with SFE enabled, did lsmod before and after enabling QoS (indeed with Cake). Without QoS, there was a module fast_classifier at the top of the list. When QoS was enabled, that module disappeared. So QoS use forces SFE off internally.

I have QoS set up with LAN&WLAN/HTB/Cake and five interface priorities (incl two for bridges) set up with the priorities set from the menus on the right. All the numerical limits in the interface table are set to "none".

What I don't know is how to test this or to even verify that it is working in any way. The suggestions in the wiki article to look at /proc/net/nf_conntrack for mark=... packets is not helpful, as there are no such lines in nf_conntrack's output.

Ideas, anyone?

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Mon Sep 02, 2019 16:59    Post subject: Reply with quote
Maybe tcpdump will get count packets.

gre or grep might also do it.

In juniper Juno's

show interfaces ge-1/1/1 extensive | find "Queue counters"

show interfaces ge-1/1/1 extensive | find "CoS information"

show interfaces ge-1/1/1 extensive | find "CoS transmit"

I imagine it might be similar to this.

nvram show | grep vlan.*ports
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Mon Sep 02, 2019 17:34    Post subject: Reply with quote
The problem that came up with this is that it worked for the base interface.

ge-0/0/0

The dd-wrt equivalent is dev eth0 , etc.

It did not work for ge-0/0/0.0

This could apply to your setup because
tun1 might be a sub interface.

Also, when creating other vlans in dd-wrt
it's 0.x or .x .

In that case I haven't found a solution.

Many others have though.
eugene1973
DD-WRT User


Joined: 21 May 2017
Posts: 186

PostPosted: Mon Sep 02, 2019 19:24    Post subject: Reply with quote
For QoS, it really depends on how you are setting it. For Linux, traffic control is common for setting QoS. To see the current QoS with traffic control you can run the following command:

# tc qdisc ls
qdisc pfifo_fast 0: dev eth0 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev tun0 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
tc - traffic control command qdisc - queuing disciplines ls - list


pfifo_fast is a default. Other third party change this to Codel and such. Cake???

Here is the article.

https://unix.stackexchange.com/questions/79129/how-to-get-network-qos-statistics-in-linux-kernel
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum