V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
simonp
V2EX  ›  macOS

Ubuntu 下 pptpd,连上 vpn 之后只有发送,没有接收,上不了网怎么办。

  •  
  •   simonp · 2014-07-07 11:20:50 +08:00 · 5503 次点击
    这是一个创建于 3594 天前的主题,其中的信息可能已经有所发展或是发生改变。
    按照同一个教程,同一个Ubuntu系统,两个不同的vps
    一个完全ok,另一个连上不能上网,数据只有发送没有接收,请问各位应该怎么解决,谢谢了
    第 1 条附言  ·  2014-07-07 12:39:56 +08:00
    搞定了,因为搬瓦工是ovz的,iptables的语法不一样
    应该是如下


    iptables -t nat -D POSTROUTING -s 10.0.0.0/8 -j SNAT --to-source `ifconfig | grep 'inet addr:'| grep -v '127\.0\.0\.' | grep -v '10\.' | grep -v '172\.' | grep -v '192\.' | cut -d: -f2 | awk 'NR==1 { print $1}'`
    iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j SNAT --to-source `ifconfig | grep 'inet addr:'| grep -v '127\.0\.0\.' | grep -v '10\.' | grep -v '172\.' | grep -v '192\.' | cut -d: -f2 | awk 'NR==1 { print $1}'`

    感谢@yywudi 同学另一个帖子的回答
    7 条回复    2014-07-07 19:27:45 +08:00
    ericFork
        1
    ericFork  
       2014-07-07 12:38:51 +08:00
    是不是没在对端 iptables 里做 NAT?
    simonp
        2
    simonp  
    OP
       2014-07-07 12:41:04 +08:00
    @ericFork 已经搞定了,虽然不太懂,但是照着别人的回答弄了。一切ok,另外搬瓦工的速度真是杠杠的,DO看YouTube4K有点卡,搬瓦工竟然都不卡。。

    才5.99刀/年。。
    sandtears
        3
    sandtears  
       2014-07-07 13:27:57 +08:00
    @simonp 话说这个的 iptables 不支持 MASQUERADE 么?

    支持的话根本不用这么麻烦,直接

    iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE

    就行了
    ericFork
        4
    ericFork  
       2014-07-07 14:00:02 +08:00   ❤️ 1
    openvz 不能 MASQUERADE
    simonp
        5
    simonp  
    OP
       2014-07-07 18:59:49 +08:00
    @sandtears 不支持的,这个是openvz的
    sandtears
        6
    sandtears  
       2014-07-07 19:02:48 +08:00
    @simonp
    @ericFork

    OneAsiaHost 的 OpenVZ 是支持的。
    cakegg
        7
    cakegg  
       2014-07-07 19:27:45 +08:00   ❤️ 1
    我很难理解为什么这个帖子会在 Mac OS X 这个节点下。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   967 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:22 · PVG 05:22 · LAX 14:22 · JFK 17:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.