linode建的vpn能连上,被强的网站还是不能访问

2013-03-21 10:31:43 +08:00
 vontio
dns已设置为8.8.8.8
ping得youtb的ip为:74.125.225.7
直接使用IP访问还是访问不了

搭建vpn用的pptpd
iptables这样设置的
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
3816 次点击
所在节点    问与答
17 条回复
hadoop
2013-03-21 10:54:06 +08:00
不被墙的网站正常访问? 是从pptp 网关走的吗
vontio
2013-03-21 10:58:36 +08:00
@hadoop 不被强的能访问,在百度查ip已经变成了服务器的ip,
不知道是不是从pptp网关走的,有方法验证吗
tarsier
2013-03-21 11:01:56 +08:00
@vontio traceroute 一个ip, 看看是从哪个gateway出去的

获取,你应该把浏览器缓存清一下试试, 因为youtube的ip看起来是对的
vontio
2013-03-21 11:09:03 +08:00
@tarsier traceroute结果如下,看看有问题吗:
traceroute: Warning: youtube.com has multiple addresses; using 74.125.225.8
traceroute to youtube.com (74.125.225.8), 64 hops max, 52 byte packets
1 192.168.0.1 (192.168.0.1) 315.659 ms 401.258 ms 270.006 ms
2 router1-fmt.linode.com (184.105.143.85) 341.067 ms 406.469 ms 511.267 ms
3 10gigabitethernet2-3.core1.fmt1.he.net (64.62.250.5) 310.547 ms 279.496 ms 288.719 ms
4 10gigabitethernet1-1.core1.pao1.he.net (184.105.213.66) 352.102 ms 406.238 ms 307.195 ms
5 184.105.224.254 (184.105.224.254) 409.669 ms 301.878 ms 310.987 ms
6 216.239.49.250 (216.239.49.250) 407.850 ms
209.85.240.114 (209.85.240.114) 408.279 ms
216.239.49.250 (216.239.49.250) 275.936 ms
7 209.85.250.66 (209.85.250.66) 333.591 ms
209.85.250.64 (209.85.250.64) 401.072 ms 283.729 ms
8 216.239.46.240 (216.239.46.240) 330.550 ms 427.145 ms 405.241 ms
9 216.239.46.55 (216.239.46.55) 341.859 ms 409.235 ms 406.470 ms
10 72.14.232.140 (72.14.232.140) 342.125 ms 1118.398 ms 1001.227 ms
11 72.14.237.132 (72.14.237.132) 435.382 ms 382.424 ms 1349.031 ms
12 64.233.174.173 (64.233.174.173) 394.202 ms 373.219 ms 339.903 ms
13 ord08s05-in-f8.1e100.net (74.125.225.8) 412.571 ms 409.785 ms 409.881 ms
tarsier
2013-03-21 11:12:14 +08:00
@vontio 如果你的pptp网段是192.168.0.0/24的话,没问题啊,除了youtube上不了,twitter, fb 之类的呢?
vontio
2013-03-21 11:20:58 +08:00
@tarsier 都上不了
tarsier
2013-03-21 11:52:39 +08:00
@vontio 设置一下mtu,可能太大了。按理说traceroute都可以,网络是通的啊
pppab
2013-03-21 11:59:21 +08:00
从traceroute的结果来看我觉得单纯是因为太慢了。。
到linode就有三百多毫秒的延迟。。
tarsier
2013-03-21 12:00:07 +08:00
@pppab 延迟不至于打不开啊,至少出现个网页标题啥的
pppab
2013-03-21 12:01:02 +08:00
LZ也没说没出网页标题啊……
vontio
2013-03-21 12:08:47 +08:00
这是log输出
Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
Using interface ppp0
Connect: ppp0 <--> /dev/pts/0
MPPE 128-bit stateless compression enabled
Cannot determine ethernet address for proxy ARP
local IP address 192.168.0.1
remote IP address 192.168.0.234
vontio
2013-03-21 12:12:06 +08:00
@pppab 一点都打不开
tarsier
2013-03-21 12:14:28 +08:00
@vontio 试着把pptp的mtu值改小一点

vi /etc/ppp/ip-up

#把下面这行加在文件 #exit 之前

ifconfig $1 mtu 1400
vontio
2013-03-21 12:34:48 +08:00
@tarsier 膜拜,果然是这个问题
我刚加了一句 ifconfig ppp0 mtu 1400
一测试就过了
我的ip-up里面没有#exit
这个应该加载哪里?我的ip-up
# If /var/log/ppp-ipupdown.log exists use it for logging.
if [ -e /var/log/ppp-ipupdown.log ]; then
exec > /var/log/ppp-ipupdown.log 2>&1
echo $0 $@
echo
fi

# This script can be used to override the .d files supplied by other packages.
if [ -x /etc/ppp/ip-up.local ]; then
exec /etc/ppp/ip-up.local "$@"
fi

run-parts /etc/ppp/ip-up.d \
--arg="$1" --arg="$2" --arg="$3" --arg="$4" --arg="$5" --arg="$6"

# if pon was called with the "quick" argument, stop pppd
if [ -e /var/run/ppp-quick ]; then
rm /var/run/ppp-quick
wait
kill $PPPD_PID
fi
tarsier
2013-03-21 12:36:53 +08:00
那个exit指的是if-up所有命令结束

没有的话就相当于所有的命令执行完,只要在文件尾加上那句话,保证它能被执行到就行
vontio
2013-03-21 12:46:44 +08:00
@tarsier 这样啊,十分感谢!
iptables这句设置添加到哪个文件比较好,随系统启动
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
tarsier
2013-03-21 13:38:53 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/63587

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX