lj0014
V2EX  ›  问与答

在 DO 上搭的 PPTP 可以拨号但无法上网

  •  
  •   lj0014 · Jul 18, 2014 · 4326 views
    This topic created in 4401 days ago, the information mentioned may be changed or developed.
    在DO上也设置iptables,求指点
    7 replies    2014-07-18 23:23:10 +08:00
    princeofwales
        1
    princeofwales  
       Jul 18, 2014
    设置转发
    ericFork
        2
    ericFork  
       Jul 18, 2014
    iptables -t nat -A POSTROUTING -s 你的vpn网段 -j MASQUERADE
    yellowV2ex
        3
    yellowV2ex  
       Jul 18, 2014
    @ericFork 我知道这条命令也用过,里面的 你的vpn网段 我好想在哪个配置文件里见过,我想问 你的vpn网段 要怎么找回来或更改设置?
    leavic
        4
    leavic  
       Jul 18, 2014
    2楼的命令好像漏了一部分,没有指明出口接口:
    iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

    192.168.9.0/24,取决于你/etc/pptpd.conf里的local IP,表示的是你VPN客户端分配的IP断.

    eth0修改成你的主机的物理网络接口,在虚拟机里一般是venet0之类的名称,用ifconfig可以查看到.
    ericFork
        5
    ericFork  
       Jul 18, 2014
    @leavic 不指明则走默认路由
    usedname
        6
    usedname  
       Jul 18, 2014
    pptp穿透性太差,为了安全着想还是换别的类型的vpn吧
    lj0014
        7
    lj0014  
    OP
       Jul 18, 2014
    @ericFork
    @leavic
    设置后可以了。(为啥我原来也设置了不行?)

    @usedname 可能确实如你所说,没几下就掉线了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3679 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 04:29 · PVG 12:29 · LAX 21:29 · JFK 00:29
    ♥ Do have faith in what you're doing.