linux查看防火墙状态的方法有哪些


本文摘自PHP中文网,作者coldplay.xixi,侵删。

linux查看防火墙状态的方法:1、iptables防火墙,查看防火墙状态,代码为【service iptables status】;2、firewall防火墙,代码为【firewall-cmd --state】。

本教程操作环境:linux7.3系统,DELL G3电脑。

linux查看防火墙状态的方法:

一、iptables防火墙

1、基本操作

# 查看防火墙状态

1

service iptables status

# 停止防火墙

1

service iptables stop

# 启动防火墙

1

service iptables start

# 重启防火墙

1

service iptables restart

# 永久关闭防火墙

1

chkconfig iptables off

# 永久关闭后重启

1

chkconfig iptables on  

2、开启80端口

1

vim /etc/sysconfig/iptables

# 加入如下代码

1

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

保存退出后重启防火墙

1

service iptables restart

二、firewall防火墙

1、查看firewall服务状态

1

systemctl status firewalld

出现Active: active (running)切高亮显示则表示是启动状态。

阅读剩余部分

相关阅读 >>

Linux下如何设置用户密码永不过期

Linux立即关机命令有哪些

Linux执行php文件结果怎么看

如何处理ping ecs实例的ip地址间歇性丢包

Linux bin目录是什么

Linux系统ftp服务目录下的文件乱码

Linux export是什么意思?

如何使用Linux命令行删除文件?(代码示例)

Linux学什么

如何使用describekeypairs查询一个或多个密钥对

更多相关阅读请进入《Linux》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...