Script iptables ไว้ Force ให้ เครื่อง วิ่งเข้า Squid ที่เป็น Transparent

Embed Size (px)

Citation preview

  • 8/7/2019 Script iptables Force Squid Transparent

    1/1

    # 1 for switch ipv4 to ip_forward

    echo 1 > /proc/sys/net/ipv4/ip_forward

    # Erase all exist NAT tables

    iptables -t nat -F

    # force forward output to eth1(wan) for 2 Lan Card Only

    iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

    # Change input from eth0 (Lan) if port 80 -> port 8080 (squid port)

    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

    .