tsuibin
V2EX  ›  问与答

iptables转发配置问题请教

  •  
  •   tsuibin · Oct 9, 2013 · 3071 views
    This topic created in 4680 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   ·   2644 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 15:25 · PVG 23:25 · LAX 08:25 · JFK 11:25
    ♥ Do have faith in what you're doing.