How to Add a Port to iptables in Linux
Note: This document is for reference only. We do not take responsibility for any data loss.
Adding a Port to iptables
If you want to add port 456 to iptables, follow these steps:
Step 1: Login to Your Server
Login to your server via SSH and type the following command:
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 456 -j ACCEPT
This command will allow port 456 to pass through the firewall and be accepted by the server.