How do you open ports in firewalld on Linux?

To open a port in Linux using firewalld, you can follow the steps below:

  1. Verify if firewalld is installed and running. You can use the following command to check:
  2. Show the status of the firewalld service.
  3. If firewalld is not installed, you can use the following command to install:
  4. Install firewalld using the sudo yum command.
  5. Start the firewalld service:
  6. Start the firewalld service using sudo systemctl.
  7. Check the default firewall rules.
  8. Show all firewall settings.
  9. Open port:
  10. Add a port with the specified number to the public zone in the firewall configuration permanently.
  11. “Among them, is the specific port number you want to open.”
  12. Reload the firewall rules to make the changes take effect.
  13. Please reload the firewall using the command sudo firewall-cmd –reload.

You have now successfully opened the specified port. You can verify if the port is open by running the following command:

sudo firewall-cmd --zone=public --list-ports
Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds