Skip to content

Instantly share code, notes, and snippets.

@DykiSA
Last active February 15, 2018 06:14
Show Gist options
  • Save DykiSA/36699df31bfc38b21d221a44b35b7f45 to your computer and use it in GitHub Desktop.
Save DykiSA/36699df31bfc38b21d221a44b35b7f45 to your computer and use it in GitHub Desktop.
Tutorial Linux: Opem Port on Linux

#Opening a Port on Linux#

  1. Check if the port is being used or not (testing port 3000 in this example)

    $ netstat -na | grep 3000
    
  2. If the port is in use, then most likely it will be the software firewall blocking you. You can check by running

    $ sudo /sbin/iptables -L
    
  3. Check for the port. If it isn’t listed, you will need to add it

    $ sudo vi /etc/sysconfig/iptables
    
  4. Copy one of the other lines that is allowing a connection to (–dport) a port, and edit to allow access to your new port.

  5. Save the file

  6. Restart iptables

    $ sudo /sbin/service iptables restart
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment