日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

CENTER OS7关闭防火墙

發(fā)布時(shí)間:2023/12/15 综合教程 38 生活家
生活随笔 收集整理的這篇文章主要介紹了 CENTER OS7关闭防火墙 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

CentOS 7.0默認(rèn)使用的是firewall作為防火墻,之前版本是使用iptables。
所以在CentOS 7執(zhí)行下面命令是無法查看防火墻狀態(tài)的。

[root@localhost ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.

查看防火墻是否關(guān)閉

firewall-cmd --state

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

開啟防火墻

[root@localhost ~]# systemctl start firewalld
[root@localhost ~]# firewall-cmd --state
running
[root@localhost ~]#

關(guān)閉防火墻

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# firewall-cmd --state
not running
[root@localhost ~]# 

禁止firewall開機(jī)啟動(dòng)

[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
這樣設(shè)置的話,下次重啟開機(jī)的時(shí)候就會(huì)禁止firewall的啟動(dòng),即關(guān)閉狀態(tài)。

設(shè)置firewall開機(jī)啟動(dòng)

[root@localhost ~]# systemctl enable firewalld
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
這樣設(shè)置之后,開機(jī)就會(huì)自動(dòng)開啟防火墻。

顯示防火墻應(yīng)用列表

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

public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

[root@localhost ~]# firewall-cmd --add-service=ftp
success
[root@localhost ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh dhcpv6-client ftp
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

[root@localhost ~]#

使用firewall-cmd --add-service=ftp之后,列表顯示出多了一個(gè)ftp服務(wù)。

他強(qiáng)由他強(qiáng),清風(fēng)拂山岡。他橫任他橫,明月照大江。

總結(jié)

以上是生活随笔為你收集整理的CENTER OS7关闭防火墙的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。