February 3, 2017

IP Table with single interface

I need to set up Linux to forward traffic for specific hosts.  My VM only has one NIC.   I’m struggling to get IPTables to work.  Is it because of the single NIC?  Is it just plain easier to do with 2 NIC’s?

My goal:

when I try to SSH or HTTP, or * to 10.0.0.7, the traffic goes to 10.0.0.5 (router takes care of this).  Have 10.0.0.5 forward the traffic to 10.0.0.7.

​What I ran:

iptables -A FORWARD -s 0/0 -i eth0 -d 10.0.0.7 -o eth0 -p TCP -j ACCEPT

Click Here!