iptables pocket reference

iptables -L lists all rules 
iptables -S [chain] shows the commands that build the rules of the chain.
iptables -D [rule index or rule details] deletes a particular chain.

NAT
iptables -L -t nat lists all NAT rules.

Replace source private IP to a public one, then when reply comes back, replace the associated destination public IP back to the private one.
iptables -t nat -A POSTROUTING -s 192.168.128.4 -j SNAT --to-source 10.247.65.43
iptables -t nat -A PREROUTNG -d 10.247.65.43/32 -j DNAT --to-destination 192.168.128.4

Replacing rules
iptables -R INPUT 1 -p tcp -s 192.168.0.0/24 --dport 80 -j ACCEPT


Save modified iptables
service iptables save


Reference
Reference 2

Comments

Popular posts from this blog

Using PlayStation 1 Densha de Go controller on emulators

Using PS1/PC Densha de Go! controller SLPH-00051/TCPP-20001/DGOC-44U on PS4/Switch Densha de Go!!

Play octoshape stream on windows with VLC player