5/5 - (3 votes)

Firewall is security software used to prevent hacking attempts by hackers/attackers. Firewalls primarily operate at the network layer. which filter the packets.

The firewall software rules will decide to which packet will be allow or blocked based on the rules for those packets in the firewall.

For the Linux operating system, the firewall provides a number of core technologies as a service, the most popular of which are: firewalls and iptables.

FirewallD is a dynamic firewall manager for Linux systems. This service is used to configure network connections, thus determining which external networks or internal packets are allowed to cross the network and which are prohibited.

Start or Stop and Enable or Disable FirewallD Service

If you’re using CentOS/RHEL 7

Disable FirewallD

To disable firewalld, run the following command as root:

systemctl disable firewalld

Stop Firewalld

To stop firewalld, run the following command as root:

systemctl stop firewalld

Open a Port in Firewalld

  1. Log in to SSH
  2. Check if the application port is defined as a service (e.g. IMAPS, Kerberos, MySQL):
    Copyfirewall-cmd -get-services
    Copysudo firewall-cmd –permanent –add-port=1234/tcp
  3. Reload Firewalld to apply changes:
    Copyfirewall-cmd –reload

Check the Status of Firewalld

check the status of firewallto run the following command as root:

systemctl status firewalld

For Ubuntu follow these commands to stop/start firewall:

Enable Ufw Iptables Firewall
$ sudo ufw enable
Disable Ufw Iptables Firewall
$ sudo ufw disable
Check Status of Ufw Iptables Firewall
# sudo ufw status

Conclusion

In this article you learned how to manage firewall on linux Os and how to start and stop frewall.

Tagged in:

About the Author

Shahid Malla

Shahid Malla is an accomplished system admin and web developer, renowned for his expertise in various fields. With a strong background in WHMCS development, WordPress development, and PHP development, Shahid has honed his skills over the years to deliver exceptional results. As a top-rated freelancer, he has consistently garnered praise and recognition, earning a stellar 5-star rating from a pool of 500 reviews. Shahid's proficiency extends beyond coding and development, encompassing server configuration, server management, and web security. With his extensive knowledge and dedication to delivering high-quality solutions, Shahid Malla is your go-to professional for all your technical needs.

View All Articles