预告网站正在建设中,网上电商平台,wordpress 炫酷主题,网站空间选择的主要原则有哪些centos7防火墙工具firewall-cmd使用防火墙概述centos7防火墙工具firewall-cmd使用介绍firewalld的基本使用服务管理工具相关指令配置firewalld-cmd防火墙概述
防火墙是可以帮助计算机在内部网络和外部网络之间构建一道相对隔绝的保护屏障#xff0c;从而保护数据信息的一种技…
centos7防火墙工具firewall-cmd使用防火墙概述centos7防火墙工具firewall-cmd使用介绍firewalld的基本使用服务管理工具相关指令配置firewalld-cmd防火墙概述
防火墙是可以帮助计算机在内部网络和外部网络之间构建一道相对隔绝的保护屏障从而保护数据信息的一种技术。如果服务器开启了防火墙并设置了屏蔽外界访问的规则那么在远程连接该服务器时可能会导致访问失败。 Linux系统存在不同的发行版本不同发行版本中开启或关闭系统防火墙的命令不同
centos7防火墙工具firewall-cmd使用介绍
firewalld的基本使用
启动 systemctl start firewalld
查看状态 systemctl status firewalld
停止 systemctl disable firewalld
禁用 systemctl stop firewalld
服务管理工具相关指令
systemctl是CentOS7的服务管理工具中主要的工具它融合之前service和chkconfig的功能于一体。 与firewalld相关的基本指令如下
启动一个服务systemctl start firewalld.service
关闭一个服务systemctl stop firewalld.service
重启一个服务systemctl restart firewalld.service
显示一个服务的状态systemctl status firewalld.service
在开机时启用一个服务systemctl enable firewalld.service
在开机时禁用一个服务systemctl disable firewalld.service
查看服务是否开机启动systemctl is-enabled firewalld.service
查看已启动的服务列表systemctl list-unit-files|grep enabled
查看启动失败的服务列表systemctl --failed
配置firewalld-cmd
查看版本 firewall-cmd --version
查看帮助 firewall-cmd --help
显示状态 firewall-cmd --state
查看所有打开的端口 firewall-cmd --zonepublic --list-ports
更新防火墙规则 firewall-cmd --reload
查看区域信息: firewall-cmd --get-active-zones
查看指定接口所属区域 firewall-cmd --get-zone-of-interfaceeth0
拒绝所有包firewall-cmd --panic-on
取消拒绝状态 firewall-cmd --panic-off
查看是否拒绝 firewall-cmd --query-panic
示例开启80端口
添加80端口配置 firewall-cmd --zonepublic --add-port80/tcp --permanent –permanent永久生效没有此参数重启后失效
重新载入 firewall-cmd --reload
查看-指定端口是否开启 firewall-cmd --zonepublic --query-port80/tcp
查看已开启的端口 firewall-cmd --list-port
删除80端口配置 firewall-cmd --zonepublic --remove-port80/tcp --permanent