Firewall service _iptables

modprobe ip_tables
modprobe iptable_filter
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ipt_state

 

 

Close: firewalld

systemctl stop firewalld

systemctl disable firewalld

 

Open the firewall service

[root@firewalld ~]# systemctl start iptables.service 
[root@firewalld ~]# systemctl enable iptables.service 
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.

The default rule is clear:

== -F iptables> - flush: clear all the rules, not the default rule 
iptables - the X-: delete user-defined chain 
iptables -Z: chain counter is cleared

 

Prohibit access to port 22:

[root@firewalld ~]# iptables -A INPUT -p tcp --dport 22 -j DROP

 

 

 Delete a rule set:

 

 

Guess you like

Origin www.cnblogs.com/zhanghongqi/p/11891101.html