centos7防火墙使用方法
参考网站:https://blog.csdn.net/achang21/article/details/52538049
添加开放指定端口:
[root@yao bin]# firewall-cmd --zone=public --permanent --add-port=10051/tcp
命令含义:
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
防火墙重启:
[root@yao bin]# firewall-cmd --reload
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
查看防火墙列表:
[root@yao bin]# firewall-cmd --list-all
删除制定端口:
[root@LinuxS03 ~]# vim /etc/firewalld/zones/public.xml
[root@yao ~]# cat /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"/>
<port protocol="tcp" port="22222"/>
<port protocol="tcp" port="10050"/>
<port protocol="tcp" port="10051"/>
</zone>
iptables -L -n
下面添加对特定端口开放的方法:
使用iptables开放如下端口
/sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT
保存
/etc/rc.d/init.d/iptables save
重启服务
service iptables restart
查看需要打开的端口是否生效?
/etc/init.d/iptables status
法2:
或直接编辑/etc/sysconfig/iptables
-A INPUT -p tcp -m tcp --dport 4000 -j ACCEPT
保存在前面部分
再重启:
service iptables restart
centos7防火墙使用方法的更多相关文章
- Centos7防火墙快速开放端口配置方法
▲这篇文章主要为大家详细介绍了Centos7防火墙开放端口的快速方法,感兴趣的小伙伴们可以参考一下! Firewalld服务是红帽RHEL7系统中默认的防火墙管理工具,特点是拥有运行时配置与永久配置选 ...
- CentOS7 防火墙(firewall)的操作命令
CentOS7 防火墙(firewall)的操作命令 安装:yum install firewalld 1.firewalld的基本使用 启动: systemctl start firewalld 查 ...
- [转帖]Centos7防火墙配置rich-rule实现IP端口限制访问
Centos7防火墙配置rich-rule实现IP端口限制访问 2019-02-18 18:05:35 sunny05296 阅读数 2143 收藏 更多 分类专栏: Linux 版权声明:本文 ...
- (三) Docker 常用操作与CentOS7 防火墙命令
参考并感谢 Docker 常用命令 https://docs.docker.com/engine/reference/commandline/docker/ Docker 登录docker账户 doc ...
- CentOS7 防火墙设置
CentOS7 防火墙命令 最近在公司服务器上安装了oracle12c数据库,在用数据库客户端连接的时候,连接不了.最后查找资料的原因是因为oracle的服务端口未开放. 首先还是还是输入以往的开启某 ...
- CentOS7防火墙firewalld 和 CentOS6防火墙iptables的一些配置命令
CentOS7 防火墙 一.防火墙的开启.关闭.禁用.查看状态命令 (1)启动防火墙:systemctl start firewalld (2)关闭防火墙:systemctl stop firewal ...
- centos7 防火墙一些相关设置 开机添加静态路由 特殊的方法
参考文献: https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/7/html/security_guide/s ...
- Centos6与Centos7防火墙设置与端口开放的方法
Centos升级到7之后,内置的防火墙已经从iptables变成了firewalld.所以,端口的开启还是要从两种情况来说明的,即iptables和firewalld.更多关于CentOs防火墙的最新 ...
- centos 6和centos7关闭防火墙的方法
centos 6 关闭命令: service iptables stop 永久关闭防火墙:chkconfig iptables off 两个命令同时运行,运行完成后查看防火墙关闭状态 ...
随机推荐
- CentOS7使用打开关闭防火墙与端口
systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体. 启动一个服务:systemctl start firewalld.servic ...
- hdu1165 规律递推
题意:给了公式,求A(m,n). 并不知道为什么被杭电分类塞进了dp专题,但是我一开始显然看到这个题就觉得给那个公式用函数递归一下答案肯定能出来了,只不过既然放在了dp专题里面估计这样暴力求解会TLE ...
- test20181006 石头剪刀布
题意 分析 考场做法同题解一样. std代码. #include<bits/stdc++.h> using namespace std; template <typename T&g ...
- 龙儿经理嘴上经常说的B树
国内的数据结构教材一般是按照Knuth定义,即“阶”定义为一个节点的子节点数目的最大值. 对于一棵m阶B-tree,每个结点至多可以拥有m个子结点.各结点的关键字和可以拥有的子结点数都有限制 规定m阶 ...
- STORJ 有实际应用
STORJ 有实际应用,Filezilla 支持 STORJ 的分布式协议.
- 分布式数据存储 shard(切片) 和 repali(副本) 的 节点数的关系。
1 , node 的 数量 应该大于等于 副本(指的是单个 shard 的 主副本+备份副本数)的 数量 ,如果 副本的数量大于 node 数量,那么 一个node 必定有2 个相同的 副本,这个多出 ...
- django模板里关闭特殊字符转换,在前端以html语法渲染
变量 pagination_html是一个方法返回的html代码,需要在前端渲染出来,不是当字符串显示 <!-- /.box-body --> {% autoescape off %} { ...
- 【Spring实战-2】Spring4.0.4整合Hibernate4.3.6
作者:ssslinppp 源程序下载:http://download.csdn.net/detail/ssslinppp/8751185 1. 摘要 本文主要讲解如何在Spring4.0. ...
- Python- 解决PIP下载安装速度慢 让PIP源使用国内镜像,提升下载速度和安装成功率。
原文: https://www.cnblogs.com/microman/p/6107879.html 对于Python开发用户来讲,PIP安装软件包是家常便饭.但国外的源下载速度实在太慢,浪费时间. ...
- PHP下载文件的几种方案
PHP下载远程文件的3种方法以及性能考虑 2014-02-21 0个评论 收藏 我要投稿 今天在做导出Excel的时候,总是要测试导出的Excel文件,频繁的下载和打开,很 ...