Opening ports via iptables
1. Connect to your Linux VPS/Cloud via SSH.
2. List the current IPtables rules using the following command:
3. The first firewall rule you need to add is the following one:
NOTE: This tells your Firewall to accept your current SSH connection.
4. The next step is to allow traffic on your loopback interface and to open some basic ports:
5. You are now ready to open the other ports you want to allow traffic to. Use the same command as you used to open the port 25 and 80 in the previous example.