V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
bugmenott
V2EX  ›  问与答

请问这个 iptables 命令在 debian 和 ubuntu 中一样吗?

  •  
  •   bugmenott · Jan 9, 2015 · 2245 views
    This topic created in 4125 days ago, the information mentioned may be changed or developed.
    iptables -t nat -A POSTROUTING -s 192.168.7.0/24 -j SNAT --to-source [YOUR VPS IP ADDRESS]
    我在我在ubuntu14.10下能执行,但实际没效果啊
    1 replies    2015-01-09 23:57:42 +08:00
    besto
        1
    besto  
       Jan 9, 2015
    首先,确定一下你的`/etc/sysctl.conf`文件里的`net.ipv4.ip_forward=1`是否打开,没打开请打开之后`sysctl -p` 一下。
    其次,`sudo iptables -L -t nat`查看一下 有没有生效。
    最后推荐使用 MASQUERADE规则而不是SNAT。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1068 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:27 · PVG 07:27 · LAX 16:27 · JFK 19:27
    ♥ Do have faith in what you're doing.