Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've setup a PPTPD on my VPS(Debian) which I used to use very well from my android phone and windows laptop. Now I want my new Mac Mini to use it too. It's shown the Mac can establish the vpn connection, only the browser(or curl) cannot open any webpages.

What's the problem?

BTW, I'm accessing internet through my wifi router. My android phone and windows laptop can use the vpn without any problems. Another strange thing: If my mac mini access internet directly without the router, the vpn works fine, i.e., I can connect the vpn and browser webpage as well.

The following is a session after it shows that my Mac has established a VPN connection:

JohnsMM:~ john$ nslookup www.youtube.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
www.youtube.com canonical name = youtube-ui.l.google.com.
Name:   youtube-ui.l.google.com
Address: 74.125.192.91
Name:   youtube-ui.l.google.com
Address: 74.125.192.190

JohnsMM:~ john$ ping www.youtube.com
PING youtube-ui.l.google.com (74.125.192.91): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 74.125.192.91: icmp_seq=0 ttl=49 time=1202.066 ms
64 bytes from 74.125.192.91: icmp_seq=1 ttl=49 time=306.454 ms
^C
--- youtube-ui.l.google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 306.454/605.227/1202.066/422.029 ms

JohnsMM:~ john$ curl -v www.youtube.com
* About to connect() to www.youtube.com port 80 (#0)
*   Trying 74.125.192.91...
* connected
* Connected to www.youtube.com (74.125.192.91) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r     zlib/1.2.5
> Host: www.youtube.com
> Accept: */*
>

As the above shows, when I use curl to access youtube, it stopped at the last line(after the line > Accept: */*), looks like curl is waiting for a response.

share|improve this question
    
What sort of error does it give you? Have you tried to see if pings work, to see if it is connectivity in general, or just a web issue? –  NickW Jun 4 '13 at 13:15
    
ping works. I just updated my question. –  John Wang Jun 4 '13 at 13:16
    
I'd have a look at your MTU settings on the mac. Looks like a classic case of packets getting fragmented, but not being re-assembled, or worse, dropped by firewalls. –  NickW Jun 4 '13 at 13:19
    
how to see the MTU settings ? –  John Wang Jun 4 '13 at 13:26
    
System Preferences > Network > [your connection] > Advanced... > Hardware > Configure: {Manually,Automatically} –  NickW Jun 4 '13 at 13:29
show 2 more comments

1 Answer

up vote 2 down vote accepted
+50

It seems, with the ping functioning, that the problem is with your MTU being too high, as the VPN adds headers, it means packets are getting fragmented and dropped. To adjust the MTU on your mac, open

System Preferences > Network > [your connection] > Advanced > Hardware > Configure: {Manually,Automatically}

There you will see if it is configured automatically, it will be 1500, as that works fine on normal ethernet connections. You will want to adjust this down, there is a fairly simple way of understanding how large your MTU needs to be. Following this guide here, you can use ping to determine the optimum MTU. Connect your VPN and open a Terminal window:

Type: ping -c 2 -D -s 1472 www.youtube.com 1472 is the packet size in this case. You will get one of two reponses, ping: sendto: Message too long or a normal ping reply.

Since 1472 + 28 is 1500, you should get a Message too long error. Reduce the ping number down until you get a positive reply. take the functioning number, add 28 and use that as your MTU.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.