CentOS下iptables防火墙基本操作教程
admin 阅读:25 2024-03-03
CentOS下iptables防火墙的基本操作命令:
查询防火墙状态:
[root@localhost ~]# service iptables status
停止防火墙
[root@localhost ~]# service iptables stop
启动防火墙
[root@localhost ~]# service iptables start
重启防火墙
[root@localhost ~]# service iptables restart
关闭防火墙
[root@localhost ~]# chkconfig iptables off
启用防火墙
[root@localhost ~]# chkconfig iptables on
示例:配置iptables,打开80端口。
[root@localhost ~]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
[root@localhost ~]# service iptables save
声明
1、部分文章来源于网络,仅作为参考。 2、如果网站中图片和文字侵犯了您的版权,请联系1943759704@qq.com处理!