Difference between revisions of "CentOS 7.x Basic firewalld configuration"
From Notes_Wiki
(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: #...") |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x system administration|System Administration]] > [[CentOS 7.x firewalld|Firewalld]] > [[CentOS 7.x Basic firewalld configuration]] | |||
To configure basic protection via firewalld use: | To configure basic protection via firewalld use: | ||
# Install firewalld if not present: | |||
#:<pre> | |||
#:: yum -y install firewalld | |||
#:</pre> | |||
# Add '<tt>ZONE=public</tt>' in appropriate ifcfg interface file under '<tt>/etc/sysconfig/network-scripts</tt>' folder | # Add '<tt>ZONE=public</tt>' in appropriate ifcfg interface file under '<tt>/etc/sysconfig/network-scripts</tt>' folder | ||
# Use following for new zone settings to take effect | # Use following for new zone settings to take effect | ||
Line 33: | Line 36: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x system administration|System Administration]] > [[CentOS 7.x firewalld|Firewalld]] > [[CentOS 7.x Basic firewalld configuration]] |
Latest revision as of 06:34, 25 August 2022
Home > CentOS > CentOS 7.x > System Administration > Firewalld > CentOS 7.x Basic firewalld configuration
To configure basic protection via firewalld use:
- Install firewalld if not present:
- yum -y install firewalld
- Add 'ZONE=public' in appropriate ifcfg interface file under '/etc/sysconfig/network-scripts' folder
- Use following for new zone settings to take effect
- systemctl restart network
- systemctl restart firewalld
- systemctl enable firewalld
- Use following to validate that default zone is public
- firewall-cmd --get-default-zone
- 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
- Reload firewalld using
- firewall-cmd --reload
- Check public zone rules using
- firewall-cmd --zone=public --list-all
Home > CentOS > CentOS 7.x > System Administration > Firewalld > CentOS 7.x Basic firewalld configuration