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

iptables转发配置问题请教

  •  
  •   tsuibin · Oct 9, 2013 · 2855 views
    This topic created in 4596 days ago, the information mentioned may be changed or developed.
    有网卡 eth1 eth2
    eth1 连接互联网
    eth2 连接一个交换机
    如何配置iptables,使连接交换机的设备可以访问互联网?
    ( 假设 eth2 范围 10.0.0.1~10.0.0.254)
    2 replies    1970-01-01 08:00:00 +08:00
    megaforce
        1
    megaforce  
       Oct 9, 2013   ❤️ 1
    sysctl net.ipv4.ip_forward=1
    /sbin/iptables -t nat -A POSTROUTING -s 10.0.0.1/24 -o eth1 -j MASQUERADE
    julyclyde
        2
    julyclyde  
       Oct 10, 2013   ❤️ 1
    sysctl后面似乎应该加-w参数?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   869 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 22:00 · PVG 06:00 · LAX 15:00 · JFK 18:00
    ♥ Do have faith in what you're doing.