Iptables on Ubuntu 14.04
From MyWiki
Reference - https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-iptables-on-ubuntu-14-04
All commands assume root level access
iptables -L [ -n ]
iptables -S ( reflects the commands necessary )
iptables -F ( flush the current rules )
Connecting to a vm from external ( This is good, it works )
iptables -t nat -I PREROUTING -p tcp -d 1.2.3.4 --dport 80 -j DNAT --to-destination 10.0.0.1:80 iptables -t nat -I PREROUTING -p tcp -d 1.2.3.4 --dport 22 -j DNAT --to-destination 10.0.0.2:22 iptables -I FORWARD -m state -d 10.0.0.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT
http://unix.stackexchange.com/questions/205867/viewing-all-iptables-rules
https://help.ubuntu.com/community/IptablesHowTo ( this is really old )