QOS + VPN Client interoperability available via custom rules.
Great news, thanks to @Martineau for providing a VPN server, I have been able to develop another QOS fix.
Some of you ** damn pirates ** are going to be happy with this one.
As you might of noticed, tunneled VPN traffic when the router is acting as a VPN client does not appear on the upload/download portions of QOS.
You have to understand the difference between a router acting as a VPN Server or acting as a VPN Client before attempting to use this rule.
The router has the ability to act as a VPN Client on behalf of specific LAN devices.
This means that:The router also has the ability to act as a VPN Server
1) Local devices connect to the router as normal
2) A portion of these devices (depending on configuration) will have their entire communications forwarded to a private VPN Server **typically paid**
3) The VPN server will fetch/receive data from the destination/website that the local device wanted to communicate with
4) The VPN server will return the data, in encrypted form, to the local device.
This configuration is typically used when you dont want your ISP to snoop on the contents/destination of your traffic.
This is the reverse of the above situation:
1) You are on a work/public WiFi network and you dont want your work/public network admin to spy on you.
2) Instead of paying for a private VPN Server, you can have your router host one for you, and tunnel your traffic via your local ISP
3) Your traffic will remain private from whatever network you are connected too.
4) As an added bonus, when connecting to your own hosted VPN, you can access your LAN devices just as if you never left your network.
This configuration is typically used when you want to access LAN devices or maintain privacy on a network away from your own.
Custom Rules for when Router is acting as a VPN Client
These custom rules fix tunneled traffic from being zero-rated (whitelisted) on QOS.
**THESE RULE ARE NOT APPLICABLE WHEN THE ROUTER IS ACTING AS A VPN SERVER**
Code:Download: iptables -D POSTROUTING -t mangle -o br0 -d 192.168.2.100/32 -j MARK --set-xmark 0x80000000/0xC0000000 &> /dev/null iptables -A POSTROUTING -t mangle -o br0 -d 192.168.2.100/32 -j MARK --set-xmark 0x80000000/0xC0000000
"Incoming/download" traffic is being whitelisted on the download interface since Asus is marking "download" traffic with an "upload" mark.
The rule above switches the "upload" mark back into a "download" mark.
Since the original mark is preserved, download traffic will remain correctly identified by traffic type.
192.168.2.100/32 should be the iprange of your tunneled devices
Code:Upload: iptables -D OUTPUT -t mangle -o eth0 ! -s 192.168.2.1 -p udp --dport 25000 -j MARK --set-mark ${Downloads_mark} &> /dev/null iptables -A OUTPUT -t mangle -o eth0 ! -s 192.168.2.1 -p udp --dport 25000 -j MARK --set-mark ${Downloads_mark}
The upload mark assigned to upload traffic is completely lost after entering the VPN tunnel.
As a result, we have to lump ALL upload vpn traffic into a fixed user defined category.
192.168.2.1 should be changed to the IP of your router
-p udp --dport 25000 should be changed to the ports of your VPN host/provider.
Enjoy!
To anyone who this working, are we simply making changes to the script with new rules or do we copy and paste this new rules to the script? I'm trying to setup my VPN client with these new rules ...
Those are an additional set of 2 rules//4 entries that need to be added into the existing script.
(You may potentially have more rules depending on your VPN client iprange)
Don’t understand what else you can do with the VPN rules besides add them into the script.
-p udp --dport 25000 should be changed to the ports of your VPN host/provider.
Whichever port you defined in the router.
Your VPN server offers many ports to connect on but as a client you can choose which port you want to use for communication.
If your router is not acting as a VPN client on behalf of you local/LAN devices, that section is not for you.
So with this said, is it ok to leave port as 25000? Thanks
Last dumb question of the day (i promise) is there a way i can find out what my define port would be?no, it has to match your defined port
Last dumb question of the day (i promise) is there a way i can find out what my define port would be?
I've been searching this thread for some time, and really don't like to duplicate work for folk... but here goes:Don't add it another ip to the script... u just need to give your consoles a static ip that fall between these lines:
192.168.2.100 - 192.168.2.103
I've been searching this thread for some time, and really don't like to duplicate work for folk... but here goes:
If I set my consoles static IP's in the DHCP route table as follows (and match the IP in my consoles Network settings), the stock script will work for correct gaming traffic prioritisation without the need to modify the script? I understand that if I want gaming above VOIP, I need to make a change in prioritisation.
Ps4 Pro 192.168.2.100
Ps4 192.168.2.101
PS3 192.168.2.102
Am I understanding this correctly? I usually follow 192.168.1.xxx
Noob question to finish: I assume that only PC games need ports to be prioritised for specific games? A console, is a console and this gaming traffic is differentiated by defined IP attached to MAC?
I'm setting up my 86U tomorrow and currently working blind, but will flash Merlin, get set up as best I can and then look to implement the script once I've breathed life back into the network. I'm sure I'll have a few more questions before long!
Every day is a school day... I've always assigned them inside them the DHCP range 192.168.1.2-254. Never had any problems doing it that way with NAS/VPN/Consoles. What is the consequence of assigning them within the DHCP range?Also when doing that as you probably know you should set your statics out of dhcp range.
As for your ports question, everything uses ports for different services. The only difference with consoles is a lot of the same ports are used for most things on them.
Gotcha. I have always set my console connections up manually and use the static IP address so that I can be sure all's as I require. Seems to work ok, but thanks for the pointer. Anyway, a bit off topic.1) Once you assign the consoles a static DHCP IP, you don’t have to modify their network settings to pull that specific IP. They will be assigned it.
Understood, and what I expected in all honesty. I took what was in the post I originally quoted too literally.2) You still have to enable the rules in the script after the DCHP assignment. This is all explained in post3.
Well understood.3) You can still use 192.168.1.xxx, just modify the rule to match.
What is the consequence of assigning them within the DHCP range?
Got ya. Will I have to assign ports for specific console games, or will the IP allocation and rule/rank take care of that for me?
I just reduced my DHCP range to 192.168.1.2-100 for a quick and dirty test as all my static IPs were outside of that range, and pretty much everything fell over
For the ASUS DHCP server, every device is assigned a DHCP address as a function of their MAC address. (eg. it is not a sequential / incremental assignment scheme)
Two devices can never be assigned a duplicate IP.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!