19
2024
06
15:56:11

Linux防火墙firewall、iptables



推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

一、iptables防火墙

1、基本操作

查看防火墙状态 service iptables status

查看iptables规则 iptables -nvL

停止防火墙 service iptables stop

启动防火墙service iptables start

重启防火墙service iptables restart

永久关闭防火墙chkconfig iptables off

永久关闭后重启chkconfig iptables on  

2、开启80端口

vim /etc/sysconfig/iptables

关闭service firewalld stop

4、查看防火墙规则firewall-cmd --list-all

5、查询、开放、关闭端口

查询端口是否开放firewall-cmd --query-port=8080/tcp

开放80端口firewall-cmd --permanent --add-port=80/tcp
移除端口firewall-cmd --permanent --remove-port=8080/tcp

重启防火墙(修改配置后要重启防火墙)firewall-cmd --reload

参数解释

1、firwall-cmd:是Linux提供的操作firewall的一个工具; 2、--permanent:表示设置为持久; 3、--add-port:标识添加的端口;


本文链接:http://hqyman.cn/post/6716.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下~~


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: