PPTP VPN tunnel unable to load some websites

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
zonnebril
DD-WRT User


Joined: 10 Jan 2011
Posts: 56

PostPosted: Thu Feb 03, 2011 14:22    Post subject: Reply with quote
lightman wrote:
the location to download it for my router linksys with the broadcom chipset is overhere
ftp://ftp.dd-wrt.com/others/eko/V24-K26/svn15943-snow/


Hmm.. don't believe its suitable for the TPLINK routers. I think I stay with the brainslayer FW.

The VPN is not stable with the automatic import of the iptable. I would like to know where the daemon is on the filesystem so I can test with it (stop en start).
Sponsor
zonnebril
DD-WRT User


Joined: 10 Jan 2011
Posts: 56

PostPosted: Thu Feb 03, 2011 16:04    Post subject: Reply with quote
I think i finally got the steps right now.

1) In the DDWRT GUI go to "Administration"
2) Click "commands"
3) Paste this codes in the white command box (-n means newline):

stopservice pptpd && startservice pptpd

AND (not for pasting Wink )

echo -n 'iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu' >> /tmp/pptpd/ip-up

4) Choose "Save Startup".

When you reboot you router now, the settings are saved. The "stopservice pptpd && startservice pptpd" has to execute before the adding of the iptables though. Because if you do afterwards, the entry is gone again Shocked Laughing
You would think that is will do nothing then when it is restarted first, but is seems it does... Shocked Very Happy

This seems to work stable now.
diff
DD-WRT Novice


Joined: 30 Mar 2011
Posts: 2

PostPosted: Wed Mar 30, 2011 15:28    Post subject: Reply with quote
What I don't understand about all of this, is that this line is already in /tmp/pptpd/ip-up;

Code:
#!/bin/sh
startservice set_routes
echo $PPPD_PID $1 $5 $6 $PEERNAME >> /tmp/pptp_connected
iptables -I FORWARD -i $1 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtuiptables -I INPUT -i $1 -j ACCEPT
iptables -I FORWARD -i $1 -j ACCEPT
iptables -t nat -I PREROUTING -i $1 -p udp -m udp --sport 9 -j DNAT --to-destination 192.168.0.255
IN=`cat /var/run/radattr.$1 | grep -i RP-Upstream-Speed-Limit | awk '{print $2}'`
OUT=`cat /var/run/radattr.$1 | grep -i RP-Downstream-Speed-Limit | awk '{print $2}'`
if [ ! -z $IN ] && [ ! -z $OUT ] && [ $IN -gt 0 ] && [ $OUT -gt 0 ]
then   tc qdisc del root dev $1
   tc qdisc del dev $1 ingress
    tc qdisc add dev $1 root tbf rate "$OUT"kbit latency 50ms burst "$OUT"kbit
    tc qdisc add dev $1 handle ffff: ingress
    tc filter add dev $1 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate "$IN"kbit burst "$IN"kbit drop flowid :1
fi


It's also already lists as a rule in iptables ... twice;

Code:
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     0    --  anywhere             anywhere           
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT     gre  --  192.168.0.0/24       anywhere           
ACCEPT     tcp  --  192.168.0.0/24       anywhere            tcp dpt:1723
ACCEPT     0    --  anywhere             anywhere           
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
lan2wan    0    --  anywhere             anywhere           
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
TRIGGER    0    --  anywhere             anywhere            TRIGGER type:in match:0 relate:0
trigger_out  0    --  anywhere             anywhere           
ACCEPT     0    --  anywhere             anywhere            state NEW
DROP       0    --  anywhere             anywhere


So why do I need to run this command to have this same line show up THREE times before I can load these sites?



Code:
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu


Code:
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT     0    --  anywhere             anywhere           
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT     gre  --  192.168.0.0/24       anywhere           
ACCEPT     tcp  --  192.168.0.0/24       anywhere            tcp dpt:1723
ACCEPT     0    --  anywhere             anywhere           
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
lan2wan    0    --  anywhere             anywhere           
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
TRIGGER    0    --  anywhere             anywhere            TRIGGER type:in match:0 relate:0
trigger_out  0    --  anywhere             anywhere           
ACCEPT     0    --  anywhere             anywhere            state NEW
DROP       0    --  anywhere             anywhere


I must be missing something?

Edit:
After adding this new rule; the packets aren't even matching it, they're matching the original rule. Something else has to be going on here?

Not working:
Code:
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 TCPMSS     tcp  --  ppp0   any     anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
    4   204 TCPMSS     tcp  --  any    any     anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Working: (after adding the above rule)
Code:
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 TCPMSS     tcp  --  any    any     anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
    0     0 TCPMSS     tcp  --  ppp0   any     anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
   11   564 TCPMSS     tcp  --  any    any     anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU


Last edited by diff on Wed Mar 30, 2011 16:54; edited 1 time in total
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Wed Mar 30, 2011 16:54    Post subject: Reply with quote
diff wrote:
What I don't understand about all of this, is that this line is already in /tmp/pptpd/ip-up;

Probably because you're using a more recent build that has fixed it, but of course you didn't mention anything about your build or hardware.

The reason that there is two similar rules is because the firmware creates one by default to clamp all TCP connections, but the ip-up script has to insert an ACCEPT rule above that. An ACCEPT rule short circuits the chain (no further rules are processed) so the default clamp rule wouldn't be matched. Therefore an additional rule to clamp TCP connection for the tunnel is placed above the rule to ACCEPT traffic for the tunnel.

It could be cleaned up by using more chains, but the most important thing is that it works.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
diff
DD-WRT Novice


Joined: 30 Mar 2011
Posts: 2

PostPosted: Wed Mar 30, 2011 17:08    Post subject: Reply with quote
phuzi0n wrote:
Probably because you're using a more recent build that has fixed it, but of course you didn't mention anything about your build or hardware.


I'm using DD-WRT v24-sp2(03/17/11) std (build 16454) on a netgear wndr3700v2, and it's not fixed. I'm still having this issue and needing to run this iptables rule to get certain websites to load over a pptp vpn connection.

http://www.seagate.com/;
being one such example.

phuzi0n wrote:
An ACCEPT rule short circuits the chain (no further rules are processed) so the default clamp rule wouldn't be matched.


This would explain my source of confusion.

Where are these ACCEPT rules coming from, have I made some configuration via the web gui that I shouldn't have?
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Wed Mar 30, 2011 19:08    Post subject: Reply with quote
diff wrote:
Where are these ACCEPT rules coming from, have I made some configuration via the web gui that I shouldn't have?

No you haven't made any mistake, the firmware creates the ACCEPT rule because traffic for the tunnel has to be accepted or else it will be dropped by the firewall. If you want to understand any more then read the iptables documentation.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
scottz
DD-WRT Novice


Joined: 08 Apr 2011
Posts: 3

PostPosted: Fri Apr 08, 2011 20:13    Post subject: Two Solutions Reply with quote
I have a Buffalo WZR-HP-G300NH
Running DD-WRT v24-sp2 (08/07/10) std - build 14896
My test workstation having MTU issues is a Mac 10.6.7

I have two basic solutions to this problem

Solution1) May work for everyone
Put the following line in your startup script
Code:
sed -i 's/1450/1460/g' /tmp/pptpd/options.pptpd


Solution2) May be Mac specific
In your PPTP configuration enforce Encryption "Maximum (128 bit only)"

Anyone else out there happen to be having problems on Mac? Can someone try this solutions to see if they work for you?
yousaf465
DD-WRT User


Joined: 12 Sep 2010
Posts: 380

PostPosted: Sat Apr 09, 2011 7:17    Post subject: Re: Two Solutions Reply with quote
scottz wrote:
I have a Buffalo WZR-HP-G300NH
Running DD-WRT v24-sp2 (08/07/10) std - build 14896
My test workstation having MTU issues is a Mac 10.6.7

I have two basic solutions to this problem

Solution1) May work for everyone
Put the following line in your startup script
Code:
sed -i 's/1450/1460/g' /tmp/pptpd/options.pptpd


Solution2) May be Mac specific
In your PPTP configuration enforce Encryption "Maximum (128 bit only)"

Anyone else out there happen to be having problems on Mac? Can someone try this solutions to see if they work for you?


You must check your mtu before adding a value, check my signature.

_________________
Upgraded to
DD-WRT v24-sp2 (03/25/13) std -
build 21061

DD-WRT v24-sp2 (10/12/12) std
(SVN revision 20119)

TP-link 741ND
DD-WRT v24-sp2 (11/21/10) std
(SVN revision 15778)

Finding the correct MTU value for your ISP | BrainSlayer Vlan on Atheros
|

debrick Buffalo WZR-HP-G300NH
scottz
DD-WRT Novice


Joined: 08 Apr 2011
Posts: 3

PostPosted: Sat Apr 09, 2011 14:36    Post subject: Re: Two Solutions Reply with quote
You,
If you want to add Mac instructions, the command flags are different but the concept is the same.

ex)
$ ping -s 1480 -D yahoo.com
PING yahoo.com (98.137.149.56): 1480 data bytes
ping: sendto: Message too long
ping: sendto: Message too long

$ ping -s 1470 -D yahoo.com
PING yahoo.com (98.137.149.56): 1470 data bytes
1478 bytes from 98.137.149.56: icmp_seq=0 ttl=52 time=94.405 ms
1478 bytes from 98.137.149.56: icmp_seq=1 ttl=52 time=92.292 ms
yousaf465
DD-WRT User


Joined: 12 Sep 2010
Posts: 380

PostPosted: Mon Apr 11, 2011 4:18    Post subject: Re: Two Solutions Reply with quote
scottz wrote:
You,
If you want to add Mac instructions, the command flags are different but the concept is the same.

ex)
$ ping -s 1480 -D yahoo.com
PING yahoo.com (98.137.149.56): 1480 data bytes
ping: sendto: Message too long
ping: sendto: Message too long

$ ping -s 1470 -D yahoo.com
PING yahoo.com (98.137.149.56): 1470 data bytes
1478 bytes from 98.137.149.56: icmp_seq=0 ttl=52 time=94.405 ms
1478 bytes from 98.137.149.56: icmp_seq=1 ttl=52 time=92.292 ms


Thanks man, I will add the instructions for Mac too.

_________________
Upgraded to
DD-WRT v24-sp2 (03/25/13) std -
build 21061

DD-WRT v24-sp2 (10/12/12) std
(SVN revision 20119)

TP-link 741ND
DD-WRT v24-sp2 (11/21/10) std
(SVN revision 15778)

Finding the correct MTU value for your ISP | BrainSlayer Vlan on Atheros
|

debrick Buffalo WZR-HP-G300NH
DacBj
DD-WRT Novice


Joined: 06 Oct 2010
Posts: 2

PostPosted: Sat Apr 30, 2011 7:25    Post subject: Reply with quote
Hello,

same problem here. I have a Buffalo WHR-HP-54 working as AP, router and PPTP VPN server for years now. Few days ago a friend bought Linksys WRT54 for same thing and asked me to help - so we flashed fw following this thread http://www.dd-wrt.com/phpBB2/viewtopic.php?t=52043 and in process I was thinking that my Buffalo with old v23 SP2 should be upgraded.

Well, have to say that it doesn't work properly on both of them. Connection is ok, some pages load nice and fast, some do after some time (but never complete) and some don't at all. Like wikipedia, or facebook. Reverted back to prehistoric version simply because it works Confused

Tried MTU trick, tried commands. Nope. So, V24 has a bug which will be corrected at some point or?
wolterkolja
DD-WRT Novice


Joined: 27 Oct 2011
Posts: 2

PostPosted: Thu Oct 27, 2011 21:18    Post subject: Reply with quote
Seems i have similar problem, but with one exception.


I have 1st router with:

TP-Link TL-WR841ND v7
DD-WRT v24-sp2 (11/21/10) std - build 15778
pptp server enabled

I had same problem with MTU. Then I added command @ startup:
echo -n 'iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu' >> /tmp/pptpd/ip-up
All works fine. I can open all pages when have vpn connection to 1st roter Smile


But when I another ddwrt router placed at remote site and made vpn connection from my laptop to 1st router, this MTU problem appears again. When i connect without that router all works fine again.


My laptop > 2nd router >INTERNET >1st router and pptp server

2nd router :

Dlink-DIR615 rev d
DD-WRT v24-sp2 (11/21/10) std - build 15778
Dfury
DD-WRT Novice


Joined: 07 Sep 2011
Posts: 1

PostPosted: Sat Mar 03, 2012 22:40    Post subject: Reply with quote
This may help someone else...so I figured I'd post it.

I came across this same problem today where I couldn't get all webpages to load over my Windows 7 PPTP connection to my DDWRT at home. After some searching around I came across this site:

http://windows7themes.net/how-to-change-mtu-on-windows-7.html

Going through this process, I ended up changing the MTU on my Windows 7 "VPN Connection" down to 1372. Everything seems to be working now over PPTP. I was having problems with drudge and usaa.com. They are working now.
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Sun Apr 15, 2012 14:54    Post subject: Reply with quote
and
http://svn.dd-wrt.com/changeset/19032

_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
njellis
DD-WRT Novice


Joined: 05 Apr 2012
Posts: 5

PostPosted: Tue May 15, 2012 15:34    Post subject: What worked for me Reply with quote
Thanks everyone for all the suggestions.

What worked for me:

This command: echo -n 'iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu' >> /tmp/pptpd/ip-up

AND

I had to set my MTU on the ppp0 port in the router to 1372. You may be able to use a higher settings, but after hours, i tried changing the MTU and it worked nicely.

So I added to the startup script the following:

ifconfig ppp0 mtu 1372

That was the key for me.


This forces devices that connect to the VPN to use that MTU setting, which works better for me than configuring the MTU on every device that connects independently.

-- This is on my Asus RT12 running 24sp2.
Goto page Previous  1, 2, 3, 4, 5, 6  Next Display posts from previous:    Page 5 of 6
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum