alpine-ikev2-vpn
alpine-ikev2-vpn copied to clipboard
gcp vpn unable access www.youtube.com and *.google.com
最近发现搭建的wpn服务可以正常连接,并其它域名网站可以正常访问。唯独google.com 和youtube.com等无法访问,在服务器上抓包.如下:
# tcpdump dst www.youtube.com -vv
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
07:07:56.915331 IP vpn-gateway.us-east1-b.c.hi42-top.internal > vl-in-f91.1e100.net: ICMP vpn-gateway.us-east1-b.c.hi42-top.internal unreachable - need to frag (mtu 1390), length 556
07:07:59.406171 IP 10.28.0.1.61892 > vl-in-f91.1e100.net.https: Flags [P.], seq 2756170666:2756171183, ack 3058157051, win 4128, options [nop,nop,TS val 944073215 ecr 3412000605], length 517
07:07:59.406309 IP vpn-gateway.us-east1-b.c.hi42-top.internal.61892 > vl-in-f91.1e100.net.https: Flags [P.], seq 2756170666:2756171183, ack 3058157051, win 4128, options [nop,nop,TS val 944073215 ecr 3412000605], length 517
unreachable - need to frag (mtu 1390)
,有两种解决方法:
- 修改iptables Ref:https://www.zeitgeist.se/2013/11/26/mtu-woes-in-ipsec-tunnels-how-to-fix/
- 修改vpn 服务器上eth0 的mtu值 1460 为1500(这里也可以修改客户端的值,改小一点。小于或等于 1390)
ifconfig eth0 mtu 1500
之后就正常了,继续观察下。
参考gcloud平台的介绍 如果VPN网关的mtu为1460(默认),那么客户端的mtu值要小它70.即 1460-70=1390.
感谢,当时遇到同样的问题,通过修改MTU值解决了
感谢,当时遇到同样的问题,通过修改MTU值解决了
@DGideas 客气咯。😄