iptables

To list current rules, run

To list rules in numeric format, run

To see rules with counter, use

Open port 80

To open port 8080 in iptables firewall, run

Open Port Range

Whitelist an IP

Forward a Port to Another

All request on port 80 will get forwarded to port 7080

Saving IP tables

Above IP table commands take effect immediatly, but they get lost when you reboot the PC. To make it permanent, run

You can also use

Related config are saved in

Before Flush

Make sure all Chains are set to ACCEPT, if DROP, run