We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsOperating SystemsLinuxAdministration

How to open ports on Linux operating systems?

In this article we will show you how to open ports on Linux operating systems.

 

To get the list of all open ports type one of the following commands:

 

netstat -tulpn

lsof -i -n –P

The procedure of opening ports in the Linux operating systems is associated with firewall iptables and is relatively simple.

 

In order to open an incoming TCP port, type the following command:

 

iptables -I INPUT -p tcp –dport PORTNUMBER -j ACCEPT

 

In order to open an incoming UDP port, type the following command:

 

iptables -I INPUT -p udp –dport PORTNUMBER -j ACCEPT

 

Finally save iptables for the changes to take effect.

service iptables save

Rate this Tutorial:
No CommentsLeave a Comment

Other (3)

Popular Keywords