How to Add a Port to iptables in Linux

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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Adding New IP Addresses to a CentOS/Fedora Server via SSH

Adding New IP Addresses to a CentOS/Fedora Server via SSH Follow the procedure below to add...

Disable Ping Response

Disable Ping Response What is a ping: A ping is a simple network utility used to check if a...

How To Block an IP Address

How To Block an IP Address Login to your Linux server via SSH. Blocking an IP Address To block...

How to Change SSH Port in CentOS

How to Change SSH Port in CentOS Login to your server via PuTTY or any other SSH client....

How to Reset MySQL Password

How to Reset MySQL Password If you have forgotten your MySQL root password, follow these steps...