亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

公告:魔扣目錄網(wǎng)為廣大站長提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請做好本站友鏈:【 網(wǎng)站目錄:http://www.430618.com 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

一、防火墻 開啟、關(guān)閉、查看狀態(tài)

1、開啟防火墻

[root@localhost ~]# systemctl start firewalld

2、關(guān)閉防火墻

[root@localhost ~]# systemctl stop firewalld

3、重啟防火墻

[root@localhost ~]# systemctl start firewalld

4、查看防火墻當(dāng)下的狀態(tài)

[root@localhost ~]# systemctl status firewalld

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

5、開機(jī)自動啟用防火墻

[root@localhost ~]# systemctl enable firewalld

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

6、開機(jī)默認(rèn)禁用防火墻

[root@localhost ~]# systemctl disable firewalld

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

7、查看防火墻開機(jī) 啟用/禁用 狀態(tài)

[root@localhost ~]# systemctl is-enabled firewalld

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

8、查看系統(tǒng)當(dāng)前啟動服務(wù)的列表

[root@localhost ~]# systemctl list-unit-files|grep enabled

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

9、查看啟動失敗的服務(wù)列表

[root@localhost ~]# systemctl --failed

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

二、防火墻相關(guān)命令

1、查看防火墻版本

[root@localhost ~]# firewall-cmd --version

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

2、查看幫助

[root@localhost ~]# firewall-cmd --help

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

其余還有很多

3、查看示當(dāng)前防火墻狀態(tài)

[root@localhost ~]# firewall-cmd --state

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

4、查看當(dāng)前防火墻打開的所有端口

[root@localhost ~]# firewall-cmd --zone=public --list-ports

5、更新防火墻規(guī)則

[root@localhost ~]# firewall-cmd --reload

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

6、查看防火墻區(qū)域信息

[root@localhost ~]# firewall-cmd --get-active-zones

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

7、查看指定接口所屬區(qū)域

[root@localhost ~]# firewall-cmd --get-zone-of-interface=eth0

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

8、拒絕所有包 (慎用)

[root@localhost ~]# firewall-cmd --panic-on

9、取消 包拒絕狀態(tài)

[root@localhost ~]# firewall-cmd --panic-off

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

10、查看包的拒絕狀態(tài)

[root@localhost ~]# firewall-cmd --query-panic

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

三、firewall防火墻及端口設(shè)置

1、防火墻添加端口

[root@localhost ~]# firewall-cmd --zone=public(作用域) --add-port=80/tcp(端口和訪問類型) --permanent(永久生效)

2、添加80端口

[root@localhost ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

(--permanent永久生效,沒有此參數(shù)重啟后失效)

3、重新載入防火墻配置

[root@localhost ~]# firewall-cmd --reload

4、查看指定端口狀態(tài)

[root@localhost ~]# firewall-cmd --zone= public --query-port=80/tcp

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

5、防火墻移除指定端口

[root@localhost ~]# firewall-cmd --zone=public --remove-port=80/tcp --permanent

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

6、檢查是否允許偽裝IP

[root@localhost ~]# firewall-cmd --query-masquerade

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

7、允許防火墻偽裝IP

[root@localhost ~]# firewall-cmd --add-masquerade

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

8、禁止防火墻偽裝IP

[root@localhost ~]# firewall-cmd --remove-masquerade

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

9、開放MySQL端口

[root@localhost ~]# firewall-cmd --add-service=mysql

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

10、阻止mysql端口

[root@localhost ~]# firewall-cmd --remove-service=mysql

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

11、查看開放的服務(wù)

[root@localhost ~]# firewall-cmd --list-services

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

12、開放通過tcp訪問3306

[root@localhost ~]# firewall-cmd --add-port=3306/tcp

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

13、阻止通過tcp訪問3306

[root@localhost ~]# firewall-cmd --remove-port=3306/tcp

14、開放通過udp訪問233

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

15、開放通過udp訪問233

[root@localhost ~]# firewall-cmd --add-port=233/udp

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

16、查看開放的端口

[root@localhost ~]# firewall-cmd --list-ports

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

17、端口轉(zhuǎn)發(fā)

(1)80端口轉(zhuǎn)發(fā)到8080(Tomcat的默認(rèn)端口為8080),443轉(zhuǎn)發(fā)到8443(https配置的端口為8443)

[root@localhost ~]# firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080

[root@localhost ~]# firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

(2)將80端口的流量轉(zhuǎn)發(fā)至192.168.11.11

[root@localhost ~]# firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=192.168.11.11

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

(3)將80端口的流量轉(zhuǎn)發(fā)至192.168.11.11的8080端口

[root@localhost ~]# firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=192.168.11.11:toport=8080

CentOS7 防火墻相關(guān)操作與端口配置 (收集+持續(xù)更新)

 

未完 —— 待續(xù) !

本文摘自博客

分享到:
標(biāo)簽:防火墻
用戶無頭像

網(wǎng)友整理

注冊時間:

網(wǎng)站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運(yùn)動步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績評定2018-06-03

通用課目體育訓(xùn)練成績評定