Answer the question
In order to leave comments, you need to log in
How to save iptables settings once and for all?
Centos 7
I tried different methods that are offered on the Internet, however, after restarting the system, the iptables settings are reset.
What method are you using? Centos is fresh.
Answer the question
In order to leave comments, you need to log in
On Centos 7, firewall-cmd is preinstalled. If you haven't removed it, then you should use it.
Adding port 80:
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
firewall-cmd --zone=public --remove-port=80/tcp --permanent
firewall-cmd --reload
service iptables save
service iptables restore
well, read the documentation...
yum install iptables-services
iptables -F
iptables-save | sudo tee /etc/sysconfig/iptables
All rules, for example:
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
...
iptables -L -n
iptables-save | sudo tee /etc/sysconfig/iptables
service iptables restart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question