防火墙服务_iptables

♀尐吖头ヾ 提交于 2019-12-05 00:23:45

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

 

 

关闭:firewalld

systemctl stop firewalld

systemctl disable firewalld

 

开启防火墙服务

[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.

清楚默认规则:

iptables -F ==> --flush:清楚所有规则,不会默认的规则
iptables -X                  :删除用户自定义的链
iptables -Z                  :链的计数器清零

 

禁止访问22端口:

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

 

 

 删除设定的规则:

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!