Accept a different port# in iptables Print

  • 0

Login as root

cp /etc/sysconfig/iptables /etc/sysconfig/iptables-ori01
nano /etc/sysconfig/iptables

Search for words "COMMIT"
Before COMMIT enter below:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport PORTNUMBER -j ACCEPT

Change the PORTNUMBER to the portnumber you want to allowed to access the server.


Was this answer helpful?

« Back