ZQ博客

ZQ博客
学无止境-技术在于分享
  1. 首页
  2. 技术分享
  3. 正文

Centos6.8防火墙配置

2021年 1月 12日 2429点热度 0人点赞 0条评论

Centos6.8防火墙配置

1、基本操作

# 查看防火墙状态
service iptables status

# 停止防火墙
service iptables stop

# 启动防火墙
service iptables start

# 重启防火墙
service iptables restart

# 永久关闭防火墙
chkconfig iptables off

# 永久关闭后重启
chkconfig iptables on

2、查看防火墙状态

service iptables status

3、开启端口

vim /etc/sysconfig/iptables
# 加入规则开启80端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

4、重启防火墙

service iptables restart

5、其他示例

vim /etc/sysconfig/iptables

*filter 
:INPUT ACCEPT [0:0]  #允许所有进入请求
:FORWARD DROP [0:0] #禁止转发请求
:OUTPUT ACCEPT [0:0] #允许所有output请求

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

COMMIT
标签: CentOS firewall iptables 防火墙
最后更新:2022年 8月 11日

zq

每天进步一点, 时间长了你会发现已经走了很远了

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复
分类
  • ARM
  • Docker
  • java
  • Linux
  • OpenStack问题
  • springboot
  • SpringCloud
  • 前端开发
  • 技术分享
  • 数据库
  • 未分类
  • 版本控制
文章目录
  • Centos6.8防火墙配置
    • 1、基本操作
    • 2、查看防火墙状态
    • 3、开启端口
    • 4、重启防火墙
    • 5、其他示例

COPYRIGHT ©2024 www.dowhere.com ALL RIGHTS RESERVED.and Theme Kratos