CentOS 7.x Basic firewalld configuration

From Notes_Wiki
Revision as of 08:10, 17 October 2018 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb>CentOS_7.x_firewalld|CentOS 7.x firewalld</yambe:breadcrumb> =CentOS 7.x Basic firewalld configuration= To configure basic protection via firewalld use: #...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb>CentOS_7.x_firewalld|CentOS 7.x firewalld</yambe:breadcrumb>

CentOS 7.x Basic firewalld configuration

To configure basic protection via firewalld use:

  1. Add 'ZONE=public' in appropriate ifcfg interface file under '/etc/sysconfig/network-scripts' folder
  2. Use following for new zone settings to take effect
    systemctl restart network
    systemctl restart firewalld
    systemctl enable firewalld
  3. Use following to validate that default zone is public
    firewall-cmd --get-default-zone
  4. Use following syntax to allow certain ports from outside
    firewall-cmd --zone=public --add-port=25/tcp --permanent
    firewall-cmd --zone=public --add-port=80/tcp --permanent
    firewall-cmd --zone=public --add-port=443/tcp --permanent
  5. Reload firewalld using
    firewall-cmd --reload
  6. Check public zone rules using
    firewall-cmd --zone=public --list-all



<yambe:breadcrumb>CentOS_7.x_firewalld|CentOS 7.x firewalld</yambe:breadcrumb>