OpenVPN: Help on how to setup specific traffic routing (IP and/or Port)

Scripts with setup, destroy, and modify routing tables and firewall rulesets for client connections.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Ryeuu
OpenVpn Newbie
Posts: 18
Joined: Tue Feb 23, 2016 8:25 pm

OpenVPN: Help on how to setup specific traffic routing (IP and/or Port)

Post by Ryeuu » Sun Jul 10, 2016 9:50 pm

Hello everyone! This would be my second time posting here. *TL;DR at the bottom*

I'm currently using OpenVPN to route my traffic through the server and finally to a game server.
*Player/Client(Perth) -> OpenVPN Server(Singapore) -> Game Server(Taiwan)*
This helps secure a better route for my game traffic, giving me lower latency. My goal is similar to that of a Game Tunneling Program (Like WTFast, PingZapper, Battleping, etc.)

My issue is that when I input multiple commands in the game (i.e moving and using skills), the second command is always slightly delayed. Almost as if the 'tunnel' is too small and can only fit one command at a time. Example: If I stand still and hold down the attack key, it will attack at an interval of 1 second. If I was to press and hold 'forward' and attack, it would (constantly) move forward and attack at an interval between 1 ~ 1.5 seconds. It's almost as if my latency is fluctuating. *Numbers are theoretical. The actual interval between each attack is equal to my latency, hence why I'm trying to reduce it.*

My goal is to try and configure OpenVPN so it will only forward traffic coming from the game and have all other traffic not go through the VPN and through my normal internet connection.

I read a lot about how enabling the routing of ALL internet traffic can cause the performance of the VPN to suffer. I'm hoping that this is the cause to the issue I mentioned above. My Server and Client config's are as follows:

Server Config:

Code: Select all

port 53

proto udp

dev tun

ca ca.crt
cert server.crt
key server.key  

dh dh1024.pem

server 10.0.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

push "redirect-gateway def1 bypass-dhcp"

push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

keepalive 10 120

user nobody
group nogroup

cipher none

auth none

persist-key
persist-tun

status openvpn-status.log

verb 3

sndbuf 393216
rcvbuf 393216
Client Config:

Code: Select all

client

dev tun

proto udp

remote (IP here) 53

resolv-retry infinite

nobind

user nobody
group nogroup

persist-key
persist-tun

ns-cert-type server

verb 3

cipher none

auth none

sndbuf 393216
rcvbuf 393216
I am currently hosting on an Ubuntu 14.04 VPS and using UFW for the firewall rules. I've done it before using IPTABLES and I tried search some ways to tag and route specific ports/IP's but am fairly lost. Here's an article I found: Article Here I'm kind of poking at the point of using "POSTROUTING" to forward specific port traffic to my eth0, but I'm still confused about the process, as I don't understand how splitting the traffic at the server allows non-game traffic to not go through the VPN - will I have to configure that on the client end somehow?

I know the issue is with my configuration of the server and it's clients. I've tried using branded VPN's such as PureVPN and VyprVPN, who both have an OpenVPN option and I don't experience this issue. I've also used Mudfish, an almost VPN like program but for game traffic. They use nodes which I believe are just VPS with OpenVPN set up on them. Mudfish also has a "Fast Connect" option which they describe as: "Making the node act like a proxy server rather than a router, intercepting all incoming traffic going to the destination defined by items (game ports/IPs) and mimics that the node is a destination server itself." Documentation Page Here
It makes TCP based games (Only works on TCP based games according to their documentation) feel even more responsive.

In case this information is necessary:
> OpenVPN Hosted on a VPS in Singapore,
> The game is Blade and Soul,
> The game runs on TCP but I am setting up the VPN in UDP,
> Connection through the VPN and to the game servers is stable (Tested with a 1 hour psping),
> I know the performance of the VPS is not the issue,
> Bandwidth of the VPS is not the issue (see below).
Image

TL;DR
> Almost bandwidth like issue with OpenVPN setup
> Would like assistance getting specific(game) traffic through the VPN and every other type of traffic through normal internet connection
> Information on what the cause of this issue could be
> Does using UDP as the protocol affect performance if the traffic I want to forward is TCP?

All and any help would be appreciated. Thank you (:

Post Reply