CentOS防火牆相關命令

2022-08-02 03:48:08 字數 733 閱讀 7164

檢視防火牆狀態

# service iptables status
關閉防火牆
# service iptables stop
開啟防火牆
# service iptables start
永久關閉防火牆
查詢卡機防火牆是否自啟動

[root@cactiez ~]# chkconfig --list | grep iptables

iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off

由此可見:2/3/4/5都是開機啟動,數字代表runlevel等級

[root@cactiez ~]# chkconfig iptables off

[root@cactiez ~]# chkconfig --list | grep iptables

iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

開啟防火牆自動啟動
[root@cactiez ~]# chkconfig iptables on

[root@cactiez ~]# chkconfig --list | grep iptables

iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Centos防火牆相關命令

1 開放埠 firewall cmd zone public add port 8080 tcp permanent 開放8080埠 firewall cmd zone public remove port 8080 tcp permanent 關閉8080埠 firewall cmd reload...

centos 防火牆命令

一 防火牆的開啟 關閉 禁用命令 1 設定開機啟用防火牆 systemctl enable firewalld.service 2 設定開機禁用防火牆 systemctl disable firewalld.service 3 啟動防火牆 systemctl start firewalld 4 關閉...

防火牆相關命令

firewall cmd zone public add port 6379 tcp permanent firewall cmd zone public add port 80 tcp permanent 那怎麼開啟乙個埠呢 新增firewall cmd zone public add port ...