This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run script with sudo privilege | |
# Install firewalld | |
yum install firewalld -y | |
# Stops and masks iptables if already running | |
systemctl stop iptables | |
systemctl mask iptables | |
# Enable and start firewalld | |
systemctl start firewalld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Refer to this link to understand below rules: https://wiki.centos.org/HowTos/Network/IPTables | |
# Set default input policy to ACCEPT | |
iptables -P INPUT ACCEPT | |
# Flush all current rules! | |
iptables -F | |
# Allow localhost interface | |
iptables -A INPUT -i lo -j ACCEPT |