鑑於大量企業生產環境還在使用centos 6,對照centos 7把防火牆相關命令和問題一同記憶防火牆
centos7
centos6
狀態systemctl status firewalld.service
service iptables status
開啟systemctl start firewalld.service
service iptables start
關閉systemctl stop firewalld.service
servcie iptables stop
自啟systemctl enable firewalld.service
chkconfig iptables on
禁止systemctl disable firewalld.service
chkconfig iptables off
重啟systemctlrestart firewalld.service
service iptables restart
更新firewall-cmd --reload
策略firewall-cmd --zone=public --list-port
iptables -nl
新增埠
firewall-cmd --zone=public --add-port=80/tcp --permanent
iptables -a input -p tcp --dport 80 -j accept
刪除策略
firewall-cmd --zone=public --remove-port=80/tcp --permanent
iptables -a input -p tcp --dport 80 -j reject
新增程序
firewall-cmd --zone=public --add-service=samba
刪除程序
firewall-cmd --zone=public --rmove-service=samba
--reload
:動態更新,不用重啟服務
--permanent
: 永久生效,沒有此引數重啟後失效
--zone
:作用域,乙個網絡卡同時只能繫結乙個zone
firewall-cmd --get-active-zones
輸出活躍的區域
firewall-cmd [--zone=] --list-all
輸出區域全部啟用的特性。如果省略區域,將顯示預設區域的資訊
linux7/centos7新特性之防火牆:
centos7 防火牆(firewall)的操作命令:
centos7中firewalld的安裝與使用詳解:
----to be continue
CentOS7和CentOS6的區別
centos6 ext4 centos7 xfs 說明 fdisk等磁碟操作命令使用都一樣,只是格式化磁碟時使用mkfs.xfs而不要用mkfs.ext4,ext4的檔案系統在centos7上只能讀不能寫。centos6 etc sysconfig network修改hostname的值 cento...
如何區別centos6和centos7
開機自檢,硬體自檢 mbr磁碟分割槽是一種使用最為廣泛的分割槽結構,它也被稱為dos分割槽結構,但它並不僅僅應用於 windows系統平台,也應用於linux,基於x86的unix等系統平台。它位於磁碟的0號扇區 一扇 區等於512位元組 是乙個重要的扇區 簡稱mbr扇區 1 mbr只支援2tb的硬...
Centos 6和Centos 7的區別
cat etc redhat release 檢視系統版本 1.檢視核心版本 uname a centos6.x uname r centos7.x 2.啟動載入器 centos6 grub legacy efibootmgr centos7 grub2 3.防火牆 iptables centos6...