Centos7默认安装了firewalld,如果没有安装的话,则需要YUM命令安装;firewalld真的用不习惯,与之前的iptable防火墙区别太大,但毕竟是未来主流讲究慢慢磨合它的设置规则;

安装Firewall命令:

yum install firewalld firewalld-config

Firewall开启常见端口命令:

firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --zone=public --add-port=/udp --permanent

Firewall关闭常见端口命令:

firewall-cmd --zone=public --remove-port=/tcp --permanent
firewall-cmd --zone=public --remove-port=/tcp --permanent
firewall-cmd --zone=public --remove-port=/tcp --permanent
firewall-cmd --zone=public --remove-port=/tcp --permanent
firewall-cmd --zone=public --remove-port=/udp --permanent

批量添加区间端口

firewall-cmd --zone=public --add-port=-/udp --permanent
firewall-cmd --zone=public --add-port=-/tcp --permanent
 

开启防火墙命令:

systemctl start firewalld.service

重启防火墙命令:

firewall-cmd --reload  或者   service firewalld restart

查看端口列表:

firewall-cmd --permanent --list-port

禁用防火墙

systemctl stop firewalld

设置开机启动

systemctl enable firewalld
 

停止并禁用开机启动

sytemctl disable firewalld

查看状态

systemctl status firewalld

或者

firewall-cmd --state

Centos7(Firewall)防火墙开启常见端口命令的更多相关文章

  1. Centos7(Firewall)防火墙开启常见端口命令

    使用云服务器的,一定要注意开启安全组配置的响应端口 Centos7默认安装了firewalld,如果没有安装的话,则需要YUM命令安装:firewalld真的用不习惯,与之前的iptable防火墙区别 ...

  2. CentOs7 使用iptables防火墙开启关闭端口

    CentOs7 使用iptables防火墙开启关闭端口   # 0x01介绍 iptables命令是Linux上常用的防火墙软件,是netfilter项目的一部分iptables文件设置路径:命令:v ...

  3. centos开启nginx服务成功,却无法访问。没有开启80端口。centos配置防火墙 开启80端口

    Linux配置防火墙 开启80端口 编辑配置文件/etc/sysconfig/iptables [root@weixinht ~]# vim /etc/sysconfig/iptables 1 # F ...

  4. centos7 firewall 防火墙 命令

    为了架设ss在vultr上买了一个日本的vps 用的是centos7的系统 防火墙是 firewall 捣鼓了两天 在这里总结一下. 如果小伙伴也准备在vultr上买vps  在注册是 可以使用这个优 ...

  5. Centos7防火墙开启3306端口

    CentOS7的默认防火墙为firewall,且默认是不打开的. systemctl start firewalld # 启动friewall systemctl status firewalld # ...

  6. centos7 firewall 防火墙

    在部署dubbo-monitor 和dubbo-admin zookeeper时候,外部访问不了部署好的服务,因为端口问题 ,现在把端口操作总结一下 参考: http://www.cnblogs.co ...

  7. linux 防火墙开启80端口永久保存

    经常使用CentOS的朋友,可能会遇到和我一样的问题.开启了防火墙导致80端口无法访问,刚开始学习centos的朋友可以参考下.经常使用CentOS的朋友,可能会遇到和我一样的问题.最近在Linux ...

  8. CentOs7 使用iptables开启关闭端口

    介绍 iptables命令是Linux上常用的防火墙软件,是netfilter项目的一部分 iptables文件设置路径:命令:vim /etc/sysconfig/iptables-config 注 ...

  9. Centos中iptables和firewall防火墙开启、关闭、查看状态、基本设置等(转)

    iptables防火墙 1.基本操作 # 查看防火墙状态 service iptables status   # 停止防火墙 service iptables stop   # 启动防火墙 servi ...

随机推荐

  1. 【胡思乱想】命令模式中,命令对象如何解耦Invoker和Receiver

    首先,我们得清楚为何要解耦? 耦合的坏处就是,牵一发而动全身,比如,当我更改了类A或其子类的时候,类B也要进行修改.这里,解除耦合,就意味着,即使你Receiver怎么改,添加了多少,删除了多少.我I ...

  2. linux----之tcpdump小用

    1.通过抓包大致确定访问量 #time tcpdump -nn -i eth0 'tcp[tcpflags] = tcp-syn' -c 10000 >/dev/null 根据real时间判断访 ...

  3. [转]Magento 2中文文档教程 - 配置和运行cron(定时任务)

    本文转自:https://blog.csdn.net/xz_src/article/details/72793476 cron(定时任务)概述 Magento 2 有许多功能需要用到cron(定时任务 ...

  4. Java基本——数据类型

    一.创建一个简单的Java应用程序 public class Code { public static void main(String[]args) { System.out.println(&qu ...

  5. Android的Intent你知道多少?

    https://blog.csdn.net/sinat_34383316/article/details/76039483 https://blog.csdn.net/u014492609/artic ...

  6. 【10-2】复杂业务状态的处理(从状态者模式到FSM)

    一.概述 我们平常在开发业务模块时,经常会遇到比较复杂的状态转换.比如说用户可能有新注册.实名认证中.已实名认证.禁用等状态,支付可能有等待支付.支付中.已支付等状态.OA系统里的状态处理就更多了. ...

  7. SpringBoot+Mybatis+PageHelper实现分页

    SpringBoot+Mybatis+PageHelper实现分页 mybatis自己没有分页功能,我们可以通过PageHelper工具来实现分页,非常简单方便 第一步:添加依赖 <depend ...

  8. 设计模式之建造者模式(Buider)(5)

    简介 在软件开发中,也会存在一些构造非常复杂的对象,这些对象拥有一系列的成员属性,这些成员属性有些是基本数据类型,有些是引用类型,总之就是一句话,这个对象的构建比较复杂.在这里我们就将复杂对象当做汽车 ...

  9. HDU1260(KB12-H DP)

    Tickets Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

  10. 获取url地址的参数值

    使用频率很高,百度了记录一下 $.getUrlParam = function (name) { var reg = new RegExp("(^|&)" + name + ...