| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3326 人关注过本帖
标题:centos7防火墙指令
只看楼主 加入收藏
岛鲸
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2017-6-15
收藏
 问题点数:0 回复次数:0 
centos7防火墙指令
CentOS 7默认使用的是firewall作为防火墙,这里改为iptables防火墙。
-------------3A-------------3A-------------我是可爱的分割线-------------3A-------------3A-------------3A-------------

firewall操作:

# service firewalld status; #查看防火墙状态


(disabled 表明 已经禁止开启启动 enable 表示开机自启,inactive 表示防火墙关闭状态 activated(running)表示为开启状态)

# service firewalld start;  或者 #systemctl start firewalld.service;#开启防火墙
# service firewalld stop;  或者 #systemctl stop firewalld.service;#关闭防火墙

# service firewalld restart;  或者 #systemctl restart firewalld.service;  #重启防火墙

# systemctl disable firewalld.service#禁止防火墙开启自启


# systemctl enable firewalld#设置防火墙开机启动
#yum remove firewalld#卸载firewall

安装iptables防火墙及操作:

#yum install iptables-services#安装iptables防火墙

#vi /etc/sysconfig/iptables#编辑防火墙配置文件,开放3306端口

   添加配置:-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

#systemctl restart iptables.service
#最后重启防火墙使配置生效

#systemctl enable iptables.service
#设置防火墙开机启动

-------------3A-------------3A-------------我是可爱的分割线-------------3A-------------3A-------------3A-------------
搜索更多相关主题的帖子: 防火墙 service 状态 表示 开机 
2017-07-12 08:30
快速回复:centos7防火墙指令
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027176 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved