centos 7如何使用firewalld 添加策略

1、运行、停止、禁用firewalld

启动:# systemctl start  firewalld

查看状态:# systemctl status firewalld 或者 firewall-cmd --state

停止:# systemctl disable firewalld

禁用:# systemctl stop firewalld

2、vim /etc/firewalld/zones/public.xml

<?xml version="1.0" encoding="utf-8"?>

<zone>

<short>Public</short>

<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>

<service name="dhcpv6-client"/>

<service name="ssh"/>      ****添加服务

<service name="https"/>

<port protocol="tcp" port="8080" />       *****添加端口

</zone>

参考:http://www.jb51.net/article/97964.htm

时间: 2024-08-29 10:26:08

centos 7如何使用firewalld 添加策略的相关文章

CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙

CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙 时间:2014-10-13 19:03:48  作者:哎丫丫  来源:哎丫丫数码网  查看:11761  评论:2 service firewalld stop 1. Disable Firewalld Service. [root@rhel-centos7-tejas-barot-linux ~]# systemctl mask firewalld 2. Stop Firewalld Service. [ro

[转] CentOS 7 为firewalld添加开放端口及相关资料

转自http://www.cnblogs.com/hubing/p/6058932.html 1.运行.停止.禁用firewalld 启动:# systemctl start  firewalld 查看状态:# systemctl status firewalld 或者 firewall-cmd --state 停止:# systemctl disable firewalld 禁用:# systemctl stop firewalld 查看firewall是否运行,下面两个命令都可以 syste

【Linux笔记】CentOS 7 systemctl、firewalld

一.CentOS7 systemctl 在CentOS7中,进行chkconfig命令操作时会发现有类似“systemctl.....”的提示,systemctl可以简单实现service和chkconfig的结合,这样通过一个命令就可以实现两个命令的功能. systemctl命令的基本操作格式是: systemctl [OPTIONS...] {COMMAND}... 以nginx服务为例,实现停止.启动.重启的动作如下: systemctl stop nginx.service system

CentOS 6.5安装Openldap添加memberof属性

默认情况下,openLDAP安装之后schema中是没有memberof属性的,如果只是通过ldap进行系统登录认证还没有什么影响,但是如果是和第三方应用结合,那么这就成了一件痛苦的事儿. 环境说明 主机名 角色 IP地址 ldapserver.contoso.com openLDAP server 192.168.49.139 一.准备环境 [[email protected] ~]# iptables -L -n Chain INPUT (policy ACCEPT) target     

centos 5.5版本中添加ext4格式

1.我在使用centos 5.5版本做练习的时候发现默认是不支持ext4文件格式. 在添加硬盘后,用fdisk -l 查看到信息如下: 分区完后,使用命令:mkfs -t ext4 /dev/sdb会提示mkfs.ext4: No such file or directory.如下图: 为了让系统支持ext4文件格式,特作如下操作: 1.查看当前系统的版本信息:lsb_release -a 2.查看版本是否有ext4模块 3.查看是否加载了ext4模块 说明没有加载ext4模块. 4.加载ext

在CentOS下使用文件批量添加用户

在CentOS添加用户的方法是多样的,例如,使用useradd.passwd单个添加用户:使用脚本批量添加用 户:使用文件批量导入用户.本节介绍的是使用文件批量导入用户的方法. 环境介绍: [[email protected] ~]# uname -r 3.10.0-327.el7.x86_64 [[email protected] ~]# cat /etc/centos-release CentOS Linux release 7.2.1511 (Core) [[email protected

CentOS下安装Nginx并添加nginx_upload_module

安装前,最好能保证依赖的系统软件已经升级.    yum update CentOS上安装Nginx,如果只是简单安装,不附加其他第三方模块,一句话可以搞定:    yum install nginx 但是如果需要添加第三方的module则需要下载源码并重新编译安装了.(也可能有简单方法,本人不知,如果真有,还请路过的高人指点.) 我这里要添加两个第三方模块,用来作文件上传和上传进度条nginx_upload_module和nginx-upload-progress-module. 这里需要安装

CentOS7 为firewalld添加开放端口

1.运行.停止.禁用firewalld 启动:# systemctl start  firewalld 查看状态:# systemctl status firewalld 或者 firewall-cmd --state 停止:# systemctl disable firewalld 禁用:# systemctl stop firewalld 那怎么开启一个端口呢 添加 firewall-cmd --zone=public --add-port=80/tcp --permanent    (--

CentOS7为firewalld添加开放端口及相关操作

1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体. 启动一个服务:systemctl start firewalld.service 关闭一个服