×

Linux防火墙firewall、iptables

hqy hqy 发表于2024-06-19 15:56:11 浏览421 评论0

抢沙发发表评论

一、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:标识添加的端口;




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

image.png

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

分享到:
打赏

群贤毕至

访客

您的IP地址是: