<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>firewalld &#8211; 科技改变生活-雨落星辰</title>
	<atom:link href="https://p1e.cn/html/tag/firewalld/feed" rel="self" type="application/rss+xml" />
	<link>https://p1e.cn</link>
	<description>所有的伟大,都源于一个勇敢的开始</description>
	<lastBuildDate>Tue, 02 Mar 2021 11:20:33 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>firewalld的基本使用</title>
		<link>https://p1e.cn/html/2686.html</link>
					<comments>https://p1e.cn/html/2686.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Tue, 02 Mar 2021 11:15:27 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[firewalld]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2686</guid>

					<description><![CDATA[1、firewalld的基本使用 启动：  systemctl start firewalld 查看状态：  systemctl status firewalld 停止：  systemctl disable firewalld 禁用：  systemctl stop firewalld &#160; 2.systemctl是CentOS7的服务管理工具中主要的工具，它融合之前service和chkconfig的功能于一体。 启动一个服务： systemctl start firewalld.service 关闭一]]></description>
										<content:encoded><![CDATA[<h1 id="hid-5EJD22">1、firewalld的基本使用</h1>
<p><strong>启动</strong>： </p>
<pre>systemctl start firewalld</pre>
<p><strong>查看状态</strong>： </p>
<pre>systemctl status firewalld</pre>
<p><strong>停止</strong>： </p>
<pre>systemctl disable firewalld</pre>
<p><strong>禁用</strong>： </p>
<pre>systemctl stop firewalld</pre>
<p>&nbsp;</p>
<h1 id="hid-xtGNw2">2.systemctl是CentOS7的服务管理工具中主要的工具，它融合之前service和chkconfig的功能于一体。</h1>
<p><strong>启动一个服务</strong>：</p>
<pre>systemctl start firewalld.service</pre>
<p><strong>关闭一个服务</strong>：</p>
<pre>systemctlstop firewalld.service</pre>
<p><strong>重启一个服务</strong>：</p>
<pre>systemctlrestart firewalld.service</pre>
<p><strong>显示一个服务的状态</strong>：</p>
<pre>systemctlstatus firewalld.service</pre>
<p><strong>在开机时启用一个服务</strong>：</p>
<pre>systemctlenable firewalld.service</pre>
<p><strong>在开机时禁用一个服务</strong>：</p>
<pre>systemctldisable firewalld.service</pre>
<p><strong>查看服务是否开机启动</strong>：</p>
<pre>systemctlis-enabled firewalld.service</pre>
<p><strong>查看已启动的服务列表</strong>：</p>
<pre>systemctllist-unit-files|grep enabled</pre>
<p><strong>查看启动失败的服务列表</strong>：</p>
<pre>systemctl--failed</pre>
<h1>3.配置firewalld-cmd</h1>
<p><strong>查看版本</strong>： </p>
<pre>firewall-cmd --version</pre>
<p><strong>查看帮助</strong>： </p>
<pre>firewall-cmd --help</pre>
<p><strong>显示状态</strong>： </p>
<pre>firewall-cmd --state</pre>
<p><strong>查看所有打开的端口</strong>： </p>
<pre>firewall-cmd--zone=public --list-ports</pre>
<p><strong>更新防火墙规则</strong>： </p>
<pre>firewall-cmd --reload</pre>
<p><strong>查看区域信息</strong>:  </p>
<pre>firewall-cmd--get-active-zones</pre>
<p><strong>查看指定接口所属区域</strong>： </p>
<pre>firewall-cmd--get-zone-of-interface=eth0</pre>
<p><strong>拒绝所有包</strong>：</p>
<pre>firewall-cmd --panic-on</pre>
<p><strong>取消拒绝状态</strong>： </p>
<pre>firewall-cmd --panic-off</pre>
<p><strong>查看是否拒绝</strong>： </p>
<pre>firewall-cmd --query-panic</pre>
<p>那怎么<strong>开启一个端口</strong>呢</p>
<p><strong>添加</strong></p>
<pre>firewall-cmd --zone=public --add-port=80/tcp --permanent</pre>
<p>   （&#8211;permanent永久生效，没有此参数重启后失效）</p>
<p><strong>重新载入</strong></p>
<pre>firewall-cmd --reload</pre>
<p><strong>查看</strong></p>
<pre>firewall-cmd --zone=public --query-port=80/tcp</pre>
<p><strong>删除</strong></p>
<pre>firewall-cmd --zone=public --remove-port=80/tcp --permanent</pre>
<p>查看firewall是否运行,下面两个命令都可以</p>
<pre>systemctl status firewalld.service</pre>
<pre>firewall-cmd --state</pre>
<p>查看当前开了哪些端口</p>
<p>其实一个服务对应一个端口，每个服务对应/usr/lib/firewalld/services下面一个xml文件。</p>
<pre>firewall-cmd --list-services</pre>
<p>查看还有哪些服务可以打开</p>
<pre>firewall-cmd --get-services</pre>
<p>查看所有打开的端口：</p>
<pre>firewall-cmd --zone=public --list-ports</pre>
<p>更新防火墙规则：</p>
<pre>firewall-cmd --reload</pre>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2686.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
