Home > OS >  Centos 7 iptables delete not to drop the rules
Centos 7 iptables delete not to drop the rules

Time:09-30

Platform: centos7
I use the command:

See,
The iptables - t filter - line - vnL INPUT

Generally speaking, there are 7 is as follows:
7, 637, 25983 REJECT all - * * 0.0.0.0/0 0.0.0.0/0 REJECT - with icmp host - prohibited

Then, I use delete command:
The iptables - D INPUT 7


Then save:
Service iptables save


But after the restart the firewall, again,
Systemctl restart firewalld. Service


Could you tell me how to permanently delete the next one?

CodePudding user response:

You in 7 system with 6 orders, of course not!
If you want to use the delete command you, that you the next operation should be:
The iptables - save & gt; The/etc/sysconfig/iptables rules save
The iptables - restore & lt; The/etc/sysconfig/iptables reload rules;

If you want to use 7 orders, command should use a firewall rule command CMD - remove - to delete
Finally using the command: firewall - CMD - reload to take effect, rather than use the restart

CodePudding user response:


1/f, reference ah this reply:
you in 7 system with 6 orders, of course not!
If you want to use the delete command you, that you the next operation should be:
The iptables - save & gt; The/etc/sysconfig/iptables rules save
The iptables - restore & lt; The/etc/sysconfig/iptables reload rules;

If you want to use 7 orders, command should use a firewall rule command CMD - remove - to delete
Finally using the command: firewall - CMD - reload to take effect, rather than using restart


Thank you first of all,
I use: firewall - CMD - list - rich - rules the check list of rules, the result is an empty list, not the one I want to delete,

Use your hair two commands, execution, execution:
Systemctl restart firewalld. Service

The question remains,

CodePudding user response:

You this is the iptables rules, not firewalld rules, you don't need to go to systemctl restart firewalld. Service
You look at the/etc/sysconfig/iptables documents have this rule
  • Related