centos 7.X & centos6.X 防火墙基本命令
Centos 7 firewall 命令:
查看已经开放的端口:
firewall-cmd --list-ports
开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
命令含义:
–zone #作用域
–add-port=80/tcp #添加端口,格式为:端口/通讯协议
–permanent #永久生效,没有此参数重启后失效
重启防火墙
firewall-cmd --reload #重启firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
CentOS 7 以下版本 iptables 命令
如要开放80,22,8080 端口,输入以下命令即可
/sbin/iptables -I INPUT --p tcp --dport 80 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --
dport 22 -j ACCEPT
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
然后保存:
/etc/rc.d/init.d/iptables save
查看打开的端口:
/etc/init.d/iptables status
关闭防火墙
1) 永久性生效,重启后不会复原
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后复原
开启: service iptables start
关闭: service iptables stop
centos 7.X & centos6.X 防火墙基本命令的更多相关文章
- centos6和centos7的防火墙基本命令
一.centos6: 1.firewall的基本启动/停止/重启命令 $查看防火墙状态: service iptables status (/etc/init.d/iptables status) $ ...
- linux 常用命令(二)——(centos6.8-centos7)防火墙的启动、关闭
centos 6.8 [centos6.5]: 查看chkconfig列表里面是否有iptables的服务: chkconfig | grep iptables 查看防火墙状态: service ip ...
- redhat linux/CentOS 6/7 如何关闭防火墙?
redhat linux/CentOS 6/7 如何关闭防火墙?关闭防火墙iptables的具体命令如下: 临时性的完全关闭防火墙,可以不重启机器(但是重启服务器后iptables防火墙服务会自动随系 ...
- CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙
CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙 时间:2014-10-13 19:03:48 作者:哎丫丫 来源:哎丫丫数码网 查看:11761 评论:2 ...
- Centos 7和 Centos 6开放查看端口 防火墙关闭打开
Centos 7 firewall 命令: 查看已经开放的端口: firewall-cmd --list-ports 开启端口 firewall-cmd --zone=public --add-por ...
- centos6|centos7防火墙区别 | 网络配置区别
CentOS 6 Linux防火墙 service iptables status (功能描述:查看防火墙状态) chkconfig iptables –list (功能描述:查看防火墙开机启动状态) ...
- CentOS 7.0禁用iptables防火墙
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. firewall: systemctl start firewalld.service#启动firewal ...
- CentOS 7.0启用iptables防火墙
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止fir ...
- (转)CentOS 7.0关闭默认防火墙启用iptables防火墙
场景:在本地虚拟机上使用ftp软件需要进行相应的端口设置,不可避免要访问Cnetos的防火墙,默认firewall操作不方便,所以需要进行相应的替换. 1 配置防火墙,开启80端口.3306端口 1. ...
随机推荐
- 一、Python3.6+PyQt5 安装
一.安装PyQt5 方法一:使用pip3工具直接安装 直接在命令行中输入: Python 3.x pip3 install PyQt5 pip3 install PyQt5-tools Python ...
- ZOJ-1586 QS Network---最小生成树Prim
题目链接: https://vjudge.net/problem/ZOJ-1586 题目大意: 首先给一个t,代表t个测试样例,再给一个n,表示有n个QS装置,接下来一行是n个QS装置的成本.接下来是 ...
- JSON序列化类
'''pyhton的dict对象可以直接序列化为JSON的{},不过很多时候 我们更喜欢用class表示对象,比如定义Student类,然后序列化''' import json class Stude ...
- 【Web安全】DoS及其家族
不久前我分享过的Web安全概述获得了大家的广泛关注,说明大家对Web安全这一块还是很关心的,因此木可大大将陆续推出目前常见的Web攻击手段和对应的防范策略.本期向大家介绍的是DoS和它的家族. DoS ...
- 用golang实现常用算法与数据结构——跳跃表(Skip list)
背景 最近在学习 redis,看到redis中使用 了skip list.在网上搜索了一下发现用 golang 实现的 skip list 寥寥无几,性能和并发性也不是特别好,于是决定自己造一个并发安 ...
- 使用poi导出数据到excel
一.首先是导入poi所需要的jar包,我是用的是maven,添加jar包依赖 <dependency> <groupId>org.apache.poi</groupId& ...
- CodeForces 912d fishes(优先队列+期望)
While Grisha was celebrating New Year with Ded Moroz, Misha gifted Sasha a small rectangular pond of ...
- Fliptile 翻格子游戏
问题 B: [Usaco2007 Open]Fliptile 翻格子游戏 时间限制: 5 Sec 内存限制: 128 MB 题目描述 Farmer John knows that an intell ...
- ●BZOJ 2693 jzptab
题链: http://www.lydsy.com/JudgeOnline/problem.php?id=2693 题解: 莫比乌斯反演 先看看这个题,BZOJ 2154 Crash的数字表格,本题的升 ...
- codeforces round #405 B. Bear and Friendship Condition
B. Bear and Friendship Condition time limit per test 1 second memory limit per test 256 megabytes in ...