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?

Brazil VPS
Germany Cloud Servers
USA VPS
Linux Cloud Server
cPanel KVM
Ubuntu VPS
Windows Cloud Server
KVM VPS
Linux KVM Hosting
OpenVZ VPS

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

Brazil VPS
OpenVZ VPS
KVM VPS
Windows Cloud Server
Linux KVM Hosting
Linux Cloud Server
cPanel KVM
Germany Cloud Servers
Ubuntu VPS
USA VPS
Rate this Tutorial:
No Comments Leave a Comment
Leave a Comment

Other (3)

Popular Keywords