How to open a port? (CentOS 6)

Discussion in 'Systems Administration' started by Venomous_Creeper, May 31, 2017.

  1. Hello,

    How can I open a port on my dedi for votifier? I tried doing
    Code (Text):
    iptables -I INPUT -p tcp --dport 1234 --syn -j ACCEPT
    service iptables save
    service sshd restart
     
    Code (Text):
    iptables -I INPUT -p tcp --dport 1234 --syn -j ACCEPT
    service iptables save
    semanage port -a -t ssh_port_t -p tcp 1234
    service sshd restart
     
    and the gui one which is:
    Code (Text):
    system-config-firewall-tui
    service sshd restart
     
    but neither of those opened my port :(
     
    #1 Venomous_Creeper, May 31, 2017
    Last edited: May 31, 2017
  2. I'm one who's not experienced with iptables. See if you can get ufw (uncomplicated firewall), I'm pretty sure it's based on iptables. I've had great luck with it on Ubuntu Server 16.04.2 LTS, but I don't know about CentOS 6.

    ufw is much, much simpler to use and maintain. The Ubuntu wiki has a great getting started article on setting up ufw.
     
  3. I don't think it works with CentOS, at least according to the DigitalOcean guide :(
     
  4. Some screenshots that will hopefully help identify the problem :(
    change anything.PNG porttt.PNG
     
  5. do
    Code (Text):
    iptables -A INPUT -p tcp -m tcp --dport VotifierPort -j ACCEPT
     
  6. Hello, I messed up all ports and closed 21, and 25565 for some reason while trying to open a port for votifier however after hours of trying commands it worked (except for the votifier one) after I did this:
    Code (Text):
    iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
    Thanks, I will try that tomorrow :) very drained right now since I messed up my ports and had to fix them lol