Allow Access To Port in SELinux and Firewall

SELinux can be a pain at times if you don’t have a clear understanding how it works. A good chunk of resolutions around the web end up suggesting turning off SELinux completely. This, to say the least, is one of the worst things you can do to your server.

Allowing access to ports through SELinux is one of the things that came across while setting up Elasticsearch cluster on Cent OS servers and I wanted to share a quick run down of steps/commands required to allow a port through the firewall. In this example, we’ll be allowing access to port 8090.

  1. Start with checking the port allocation and confirming the port you want to allow access to isn’t already being used,
  2. Allow access to port
  3. Check firewall ports passthrough
  4. Add port (and make it permanent)
  5. Reload firewall for the changes to take effect

Good luck!

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [point] com