Adding Ports in the SELinux Port List

On a SELinux enabled machine, in order to use any port other than the default ports in the Session Monitor, add the port in the SELinux port list using the following commands.

  1. Run this command that allows SELinux-specific service and adds the port number.
    yum install -y setroubleshoot-server 
    semanage port -a -t <Service_Name> -p <Protocol> <Port_Number>
    
  2. You can view all ports allowed in the SELinux using the command:
    semanage port -l

    For example: By default, SELinux allows HTTP to listen on the TCP ports: 80, 443, 488, 8008, 8009, or 8443.

  3. To configure HTTP to run on a port other than the TCP ports listed above, such as 8001, then add the ports to the SELinux port list using the command:
    semanage port -a -t http_port_t -p tcp 8001