通过以下 Referral 链接购买 DigitalOcean 主机,你将可以帮助 V2EX 持续发展
DigitalOcean - SSD Cloud Servers
goodryb
V2EX  ›  VPS

搭了一个 ocserv,可以连接,但是无法访问网络

  •  
  •   goodryb · Nov 9, 2015 · 975 views
    This topic created in 3867 days ago, the information mentioned may be changed or developed.

    如题,是参考网上的教程,配置了 iptables ,现在防火墙如下,不知道哪里不对

    root@localhost:~# iptables -nvL
    Chain INPUT (policy ACCEPT 37429 packets, 15M bytes)
    pkts bytes target prot opt in out source destination

    901 72440 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
    124 52112 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:443

    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
    pkts bytes target prot opt in out source destination

    152 9833 ACCEPT all -- * * 10.10.0.0/24 0.0.0.0/0

    Chain OUTPUT (policy ACCEPT 37666 packets, 15M bytes)
    pkts bytes target prot opt in out source destination

    Supplement 1  ·  Nov 10, 2015
    找到原因了
    教程里面是把流量转发到 eth0 ,然而这个 VPS 的公网网卡名字不是 eth0 ,所以网络不通
    把名字改成公网网卡就可以了
    3 replies    2015-11-10 11:42:24 +08:00
    zzen
        1
    zzen  
       Nov 9, 2015
    iptables 的 net 表呢
    也贴出来啊
    srrshweee
        2
    srrshweee  
       Nov 10, 2015
    转发没有设置对。但是我也不知道是怎么设置的。哈哈
    lenovo
        3
    lenovo  
       Nov 10, 2015
    https://goo.gl/ArpwGP
    iptables 只有 3 行,工作正常
    *nat
    -A POSTROUTING -j MASQUERADE
    COMMIT
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1155 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 61ms · UTC 18:06 · PVG 02:06 · LAX 11:06 · JFK 14:06
    ♥ Do have faith in what you're doing.