Centos7 Log

前端之家收集整理的这篇文章主要介绍了Centos7 Log前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
                                            <table class="text"&gt;<tbody><tr class="li1"&gt;

<td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@H_301_1@</td>
<td class="de1"><pre class="de1">1.查看防火墙状态
[root@iZ237682 ~]# firewall-cmd --state
not running
 
2.systemctl start/stop/restart firewalld
 
3.开机启动
systemctl enable firewalld
 
4.查看防火墙规则
[root@iZ237 ~]# firewall-cmd --list-all
public
  target: default
  icmp-block-inversion: no
  interfaces:
  sources:
  services: ssh dhcpv6-client
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
 
5. 查询端口是否开放
firewall-cmd --query-port=80/tcp
6. 开放80端口
firewall-cmd --permanent --add-port=80/tcp
7. 移除端口
firewall-cmd --permanent --remove-port=80/tcp
 
8.重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload
 

参数解释

1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、--permanent:表示设置为持久;
3、--add-port:标识添加的端口;@H_301_1@</td>
</tr></table>

猜你在找的CentOS相关文章