Archive for May 2009

Traffic forwarding on linux using IPTABLES

IPTables allows you to easily setup rules for packet filtering/forwarding. So, to keep it short and simple: assume you’d like to forward any traffic coming to your machine (192.168.0.1) on port 80 to machine2 (192.168.0.2) on port 8080 then: – Enable port forwarding: echo 1 > /proc/sys/net/ipv4/ip_forward – Now add the rules: iptables -t nat [...]