Wednesday, October 27, 2021

[SOLVED] HTTP application hangs through PPTP connection

Issue

Map looks like:

[debian server with pptpd (192.168.3.59)]
  ↕
[router forwarding 1723 port]
  ↕
[internet]
  ↕
[home router]
  ↕
[ubuntu networkmanager pptp client]

Strange thing is only with http connections, no matter the server is apache2 or nginx. Nginx normally sends back non-200 responses (like 301, 404 and 500). But when file exists, connection just hangs (chrome-firefox-curl-telnet). After connection has been reset, nginx writes 200 OK to access log. Other services like ssh, mysql works fine.

Some configs:

pptpd.conf

localip 192.168.3.230-234
remoteip 192.168.3.235-240

pptpd-options

require-mschap-v2
require-mppe-128
ms-dns 192.168.3.59
proxyarp
nodefaultroute
lock
nobsdcomp
noipx
mtu 1490
mru 1490

iptables on server:

modprobe ip_tables
modprobe ip_nat_ftp
modprobe iptable_filter
modprobe iptable_nat

$IPT -P INPUT ACCEPT
$IPT -P FORWARD ACCEPT
$IPT -P OUTPUT ACCEPT

...

$IPT -A FORWARD -i ppp+ -o eth0 -j ACCEPT
$IPT -A FORWARD -i eth0 -o ppp+ -j ACCEPT
$IPT -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sysctl

net.ipv4.ip_forward=1

apache

Listen 0.0.0.0:80
# 192.168.3.59

nginx

listen 8080
# 192.168.3.59

route -n on client:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
(vpnserver)     192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
(vpnserver)     192.168.1.1     255.255.255.255 UGH   0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     1      0        0 eth1
192.168.3.0     0.0.0.0         255.255.255.0   U     0      0        0 ppp0
192.168.3.230   0.0.0.0         255.255.255.255 UH    0      0        0 ppp0

Solution

Based on these symptoms, it sounds like large packets are getting dropped by the link. Lower your pptpd-options MTU & MRU to 1392.



Answered By - This