Community discussions

MikroTik App
 
rxrxrx
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 95
Joined: Fri Mar 13, 2009 4:45 pm

mikrotik -> mikrotik pptp problem

Mon Nov 14, 2011 1:23 pm

Hello, ive a routerboard 450G at HQ, using for vpn server (pptp)
it has about 50 users, and they had no problem until now.

In a branch office, i changed the linux router, with a mikrotik (450G again). it does not do so much, just dhcp, and NAT for internet access.

But i noticed that, from that branch office, only one user can connect to HQ pptp service.

That does not happen, if the gateway of the client is not mikrotik.

any ideas on that ?
 
cieplik206
Trainer
Trainer
Posts: 290
Joined: Sun Jul 01, 2007 12:25 am
Contact:

Re: mikrotik -> mikrotik pptp problem

Tue Nov 15, 2011 1:11 pm

Looks like NAT problem, maybe you will establish PPTP directly from mikrotik ?
 
User avatar
sadeghrafie
Long time Member
Long time Member
Posts: 514
Joined: Sat Nov 14, 2009 11:28 am
Location: Bushehr, IRAN

Re: mikrotik -> mikrotik pptp problem

Tue Nov 15, 2011 1:32 pm

This is so strange that you say "only one user can connect to HQ pptp service".
You did not tell enough about your configuration. BTW, check your Conf. with http://wiki.mikrotik.com/wiki/Manual:Interface/PPTP
 
cieplik206
Trainer
Trainer
Posts: 290
Joined: Sun Jul 01, 2007 12:25 am
Contact:

Re: mikrotik -> mikrotik pptp problem

Tue Nov 15, 2011 10:35 pm

Are you blocking in forward chain any traffic somehow ?
 
CCDKP
Member Candidate
Member Candidate
Posts: 170
Joined: Fri Jan 28, 2011 11:24 pm
Location: Midwest, United States

Re: mikrotik -> mikrotik pptp problem

Wed Nov 16, 2011 12:19 am

Hello, ive a routerboard 450G at HQ, using for vpn server (pptp)
it has about 50 users, and they had no problem until now.

In a branch office, i changed the linux router, with a mikrotik (450G again). it does not do so much, just dhcp, and NAT for internet access.

But i noticed that, from that branch office, only one user can connect to HQ pptp service.

That does not happen, if the gateway of the client is not mikrotik.

any ideas on that ?
This is an issue with PPTP and and NAT, or more specifically GRE tunnels and NAT.

PPTP is comprised of 2 connections, a TCP control channel (1723) and a GRE data channel.
TCP NAT uses 4 identifiers to track a unique connection, Source port, source IP, destination port, destination IP.

Lets say for example, two PC's behind a nat router both connect to the same server over TCP. As the packets pass through the router, Snat (masquerade) changes the source IP to that of the NAT router. Even though the Source IP (WAN), Destination IP (remote server), and destination port (Service port, ie. 80, 443) are the same, the Source port is different, so two independent connections are tracked. When both packet return, Conntrack uses the now destination port (previously source port) to determine which packets get directed to which private IP.

The problem with GRE is it lacks port definitions, so conntrack can only use source and destination IP. When multiple PC's make multiple GRE connections to the same destination IP, conntrack has no way to differentiate between sessions. Now GRE does have a unique connection identifier (Key field), but few NAT implementations know how to use it.

The reason your linux router worked was as of kernel 2.6.14, a netfilter patch became available to use the GRE key in addition to source and destination ports. These are the ip_nat_pptp and ip_conntrack_pptp modules. Perhaps we could ask MikroTik nicely and see if they can implement this feature in NAT and conntrack.

The only real workaround is moving to L2TP, which uses UDP in the place of GRE.

All that aside, have you looked into a site-to-site VPN? The big advantage is you can route specific traffic over the VPN, and use the local endpoint internet for other internet traffic (akin to Cisco's split-tunnel VPN). This may not be desired depending on your application, but in typical deployments it provides better performance when all of the remote user's web browsing traffic doesn't have to go through the VPN.
 
rxrxrx
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 95
Joined: Fri Mar 13, 2009 4:45 pm

Re: mikrotik -> mikrotik pptp problem

Wed Nov 16, 2011 12:33 am

Hello, ive a routerboard 450G at HQ, using for vpn server (pptp)
it has about 50 users, and they had no problem until now.

In a branch office, i changed the linux router, with a mikrotik (450G again). it does not do so much, just dhcp, and NAT for internet access.

But i noticed that, from that branch office, only one user can connect to HQ pptp service.

That does not happen, if the gateway of the client is not mikrotik.

any ideas on that ?
This is an issue with PPTP and and NAT, or more specifically GRE tunnels and NAT.

PPTP is comprised of 2 connections, a TCP control channel (1723) and a GRE data channel.
TCP NAT uses 4 identifiers to track a unique connection, Source port, source IP, destination port, destination IP.

Lets say for example, two PC's behind a nat router both connect to the same server over TCP. As the packets pass through the router, Snat (masquerade) changes the source IP to that of the NAT router. Even though the Source IP (WAN), Destination IP (remote server), and destination port (Service port, ie. 80, 443) are the same, the Source port is different, so two independent connections are tracked. When both packet return, Conntrack uses the now destination port (previously source port) to determine which packets get directed to which private IP.

The problem with GRE is it lacks port definitions, so conntrack can only use source and destination IP. When multiple PC's make multiple GRE connections to the same destination IP, conntrack has no way to differentiate between sessions. Now GRE does have a unique connection identifier (Key field), but few NAT implementations know how to use it.

The reason your linux router worked was as of kernel 2.6.14, a netfilter patch became available to use the GRE key in addition to source and destination ports. These are the ip_nat_pptp and ip_conntrack_pptp modules. Perhaps we could ask MikroTik nicely and see if they can implement this feature in NAT and conntrack.

The only real workaround is moving to L2TP, which uses UDP in the place of GRE.

All that aside, have you looked into a site-to-site VPN? The big advantage is you can route specific traffic over the VPN, and use the local endpoint internet for other internet traffic (akin to Cisco's split-tunnel VPN). This may not be desired depending on your application, but in typical deployments it provides better performance when all of the remote user's web browsing traffic doesn't have to go through the VPN.

Thanks for the detailed information!

Yes, ive moved to site-site tunnel with l2tp as a workaround btw.

How do we ask mikrotik for a feature request ? using forums/bugtracker if exists ?
 
CCDKP
Member Candidate
Member Candidate
Posts: 170
Joined: Fri Jan 28, 2011 11:24 pm
Location: Midwest, United States

Re: mikrotik -> mikrotik pptp problem

Thu Nov 17, 2011 12:23 am

How do we ask mikrotik for a feature request ? using forums/bugtracker if exists ?
I created a Feature Request here:
http://forum.mikrotik.com/viewtopic.php?f=1&t=56780
 
cieplik206
Trainer
Trainer
Posts: 290
Joined: Sun Jul 01, 2007 12:25 am
Contact:

Re: mikrotik -> mikrotik pptp problem

Thu Nov 17, 2011 12:58 am

In fact there is a that feature already

It is called NAT helper

In fact in my network i have two sessions of PPTP behind nat,
 
User avatar
saintofinternet
Forum Veteran
Forum Veteran
Posts: 768
Joined: Thu Oct 15, 2009 3:52 am

Re: mikrotik -> mikrotik pptp problem

Tue Oct 04, 2016 4:41 am

L2TP/IPSec has similar problems.... of not allowing more than one connection from beind NAT to a Mikrotik VPN.

no solution in sight yet

Who is online

Users browsing this forum: Bing [Bot], kormenator, sstefanov and 170 guests