Community discussions

MikroTik App
 
dustynz
just joined
Topic Author
Posts: 6
Joined: Wed May 25, 2016 5:52 am

VPN and performance

Wed May 25, 2016 11:00 am

I have a question about RouterBOARD 750G r2 (v6.30) and slow VPN performance

The router is setup on a home network with a single network and a vDSL router to the internet.
The Routerboard is setup as an alternative gateway on the network and it routes traffic over the internet via a VPN.
You set the VPN gateway simply by changing the guest gateway IP.
The Routerboard config is a simple PPTP VPN using NAT/Masquerade+Mangling and route tables.

Performance of the links
Straight to vDSL router I get 60Mbps down and 30Mbps up.
Via Routerboard with VPN disabled I get 56Mbps down and 38Mbps up
Via Routerboard with VPN enabled I get 4Mbps 1Mbps up.
Ping times (google) 750ms via VPN. 56ms direct.

I know the performance of the 750 is minimal but is there a better way to route over the VPN?
Also setup on a x86/hyper-V session and only got 4Mbps down and 1.3Mbps up.

Are there better clients than PPTP for performance?
I tried routing by destination (Skips mangling) but still got the same performance
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: VPN and performance

Wed May 25, 2016 11:40 pm

What type of VPN are you using, and where does it terminate? What is the bandwidth at the other end of the tunnel? Have you tried lowering the MTU values of the tunnel to make sure packets are not getting fragmented?

The 750 should be able to get you better speed than that, but it also depends on what you have setup. The questions above can cause a large impact on performance depending on the answers. There could be more going on, but those would be the first things to check.
 
dustynz
just joined
Topic Author
Posts: 6
Joined: Wed May 25, 2016 5:52 am

Re: VPN and performance

Thu May 26, 2016 1:58 am

The VPN is a off the shelf CyberGhost VPN tunnel. On a windows machine with native windows PPTP client I am seeing close to 90% of my local link.


Whats the easiest way to see if I am getting packet fragmentation? Using std MTU of around 1450 I think

Also notice a massive jump in ping times. 50-700ms. Sure that is telling as well.
 
dustynz
just joined
Topic Author
Posts: 6
Joined: Wed May 25, 2016 5:52 am

Re: VPN and performance

Thu May 26, 2016 2:00 am

Also noticing that PPTP is one of the costliest VPN tunnels for performance and IPSEC (not L2TP) is the best.

Vendor supports IPSEC client but seems RouterOS only supports IPSEC to IPSEC (Server to Server)
 
dustynz
just joined
Topic Author
Posts: 6
Joined: Wed May 25, 2016 5:52 am

Re: VPN and performance

Thu May 26, 2016 2:22 am

Also, whats the easiest way to plot CPU load on the 750. I am assuming that if the 750 is the limit then I would see max CPU load??
 
pe1chl
Forum Guru
Forum Guru
Posts: 10240
Joined: Mon Jun 08, 2015 12:09 pm

Re: VPN and performance

Thu May 26, 2016 11:26 am

Just enable the graphing and you will have a permanent plot of CPU load.
When performance matters and the VPN is just for routing and not for hiding your super-secret communications,
I use IPsec tunnels with AH protocol. (no encryption, only signing)
This uses much less CPU than ESP on such low-end routers because it does not have to run AES or DES.
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: VPN and performance

Thu May 26, 2016 8:04 pm

The easiest way to check for fragmentation is to send out a ping with the do not fragment flag set down the VPN tunnel. In windows something like this:
ping 4.2.2.2 -l 1450 -f
It will tell you if the ping failed because the packet needed to be fragmented somewhere along the line.

The Mikrotik can act as a client for IPSec as well as a server. They just don't present it in a nice way to visualize it. It helps if you know how it works on the back end and you can adjust the settings as needed for each vendor. Each vendor will use different terms or different menus but it is all standardized how it's supposed to work. That doesn't make it always easy, but it does make it easier.

When you are getting the low bandwidth speeds what is the CPU percentage of the MikroTik? Dustynz is right on the easiest way to get historical information. You can also look at /tools profile and /system resources to get a picture of what is currently going on and taking up the CPU time. With IPSec I would expect around 20-30 Mbps of traffic from a 750, though I've never tested one directly. PPTP should have better speeds than that.
 
dustynz
just joined
Topic Author
Posts: 6
Joined: Wed May 25, 2016 5:52 am

Re: VPN and performance

Fri May 27, 2016 2:35 am

Thanks

Have had a look about to setup as an IPSec (not L2TP) tunnel client and can't seem to see anything. Are you saying I need to config at the console?

VPN supplier has provided the following ipsec settings
Destination:
UN:
PW:
SECRET:

The VPN is to a public/internet endpoint
Thanks
 
pe1chl
Forum Guru
Forum Guru
Posts: 10240
Joined: Mon Jun 08, 2015 12:09 pm

Re: VPN and performance

Fri May 27, 2016 10:46 am

Thanks

Have had a look about to setup as an IPSec (not L2TP) tunnel client and can't seem to see anything. Are you saying I need to config at the console?

VPN supplier has provided the following ipsec settings
Destination:
UN:
PW:
SECRET:

The VPN is to a public/internet endpoint
Thanks
That does not sound like valid information for a plain IPsec tunnel.
You should get your VPN provider to supply ALL the EXACT details of your VPN connection.
Trying to get IPsec working without having them is like shooting in the dark.
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: VPN and performance

Fri May 27, 2016 5:39 pm

Thanks

Have had a look about to setup as an IPSec (not L2TP) tunnel client and can't seem to see anything. Are you saying I need to config at the console?

VPN supplier has provided the following ipsec settings
Destination:
UN:
PW:
SECRET:

The VPN is to a public/internet endpoint
Thanks
That's not enough information to configure IPSec, and IPSec does not use a username and password. So chances are they are just running with L2TP/IPsec with standard Windows client settings instead of a pure IPSec setup. The MikroTik can handle that fine, it just needs to be configured properly.
1.) Configure the L2TP client with the appropriate connect to address, username, and password.
2.) Setup an IPSec peer, this is phase1 settings for IPSec:
/ip ipsec peer add address=<CyberGhost IP> auth-method=pre-shared-key dh-group=modp1024 disabled=no dpd-interval=disable-dpd dpd-maximum-failures=1 enc-algorithm=3des exchange-mode=main generate-policy=no hash-algorithm=sha1 lifebytes=0 lifetime=1d proposal-check=obey secret=<Secret key> send-initial-contact=yes
3.) Setup the IPSec proposal, these are the phase2 settings for IPSec
/ip ipsec proposal set default auth-algorithms=sha1 disabled=no enc-algorithms=3des lifetime=30m name=default pfs-group=modp1024
4.) Setup an IPSec policy, this defines what traffic the router will encrypt for IPSec
/ip ipsec policy add dst-address=<CyberGhost IP> protocol=all sa-dst-address=<CyberGhost IP> sa-src-address=<YOUR IP> src-address=<YOUR IP>/32 tunnel=yes
You will likely want to turn on IPSec debugging in the logs so you can see when/if there is an error and correct it. It will generate a lot of logs, but you can pause the log scrolling to review the messages.
/system logging
add action=memory topics=ipsec,!packet
Most of the IPSec settings I borrowed from the wiki, but modified them a bit to fit more into what you are asking about.
http://wiki.mikrotik.com/wiki/L2TP_%2B_ ... Windows_PC
 
dustynz
just joined
Topic Author
Posts: 6
Joined: Wed May 25, 2016 5:52 am

Re: VPN and performance

Sat May 28, 2016 1:32 pm

Little update
Running
ping www.google.com -l 1395 -f

Pinging www.google.com [216.58.199.36] with 1395 bytes of data:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.

Basically 1392 is when packet fragmentation stops. Have changed the Max MTU and MRU?
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: VPN and performance

Tue May 31, 2016 4:53 pm

This should do it. You can also change the L2TP's MTU value down to 1392 by editing the client interface.
/ip firewall mangle
add action=change-mss chain=forward new-mss=1392 out-interface=all-ppp protocol=tcp tcp-flags=syn tcp-mss=1393-65535
add action=change-mss chain=forward new-mss=1392 out-interface=all-ppp protocol=tcp tcp-flags=syn tcp-mss=1393-65535
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: VPN and performance

Tue May 31, 2016 5:25 pm

MTU is not the same as TCP MSS, so values in mangle rules should be 1354byte or less (subtract default size of IP header and TCP header).
Image

Who is online

Users browsing this forum: GoogleOther [Bot] and 208 guests