firewall-cmd:rhel7中的防火牆設定的命令列工具,firewall-cmdrhel7

來源:互聯網
上載者:User

firewall-cmd:rhel7中的防火牆設定的命令列工具,firewall-cmdrhel7
firewall-cmd:防火牆設定的命令列工具。  文法:firewall-cmd [OPTIONS...]常見選項:-h:列印協助資訊;-V:列印版本資訊;-q:退出,不用列印狀態資訊。狀態選項:--state:檢查防火牆進程是否啟用有效。如果有效,返回0值;否則返回非0值。--reload:重新載入防火牆規則,並保留狀態資訊。當前永久配置資訊將變成新的運行時配置資訊。--complete-reload:完全重新載入防火牆,甚至包括netfilter kernel modules也會重新載入。當前串連也會中斷,因為狀態資訊已經丟失。永久選項:--permanent:使配置永久生效。修改的配置資訊不會立即生效,只有當服務重啟、重新載入或系統重啟後生效。地區選項:--get-default-zone:串連、介面的預設區域。--set-default-zone=zone:設定預設區域。--get-active-zones:擷取當前啟用的、有效地區。[--permanent] --get-zones:擷取預定義的地區,使用空格分隔。[--permanent] --get-services:擷取預定義的服務,使用空格分隔。[--permanent] --get-icmptypes:擷取所有的ICMP類型。[--permanent] --get-zone-of-interface=interface:輸出指定網卡所屬的地區。[--permanent] --get-zone-of-source=source[/mask]:輸出指定源地址所屬的地區。[--permanent] --list-all-zones:列出所有的地區。[--permanent] [--zone=zone] --list-all:羅列出所有地區。[--permanent] [--zone=zone] --list-services:羅列出所有的服務。[--permanent] [--zone=zone] --add-service=service [--timeout=seconds]:添加服務。如果設定了timeout參數,則在timeout參數內有效,時間過後則失效。[--permanent] [--zone=zone] --remove-service=service:將某服務從地區中去除。[--permanent] [--zone=zone] --query-service=service:查詢該服務是否已經添加到該地區中。如果已經添加進去,則返回0;否則返回1。[--permanent] [--zone=zone] --list-ports:羅列出地區中的所有連接埠及協議。[--permanent] [--zone=zone] --add-port=portid[-portid]/protocol [--timeout=seconds]:在地區中添加連接埠及協議;如果設定了timeout參數,在該時間內有效;時間過後則失效。[--permanent] [--zone=zone] --remove-port=portid[-portid]/protocol:去除連接埠及協議。[--permanent] [--zone=zone] --query-port=portid[-portid]/protocol:查詢某連接埠及協議是否在地區中。[--permanent] [--zone=zone] --list-icmp-blocks:羅列該地區中的所有ICMP類型。[--permanent] [--zone=zone] --add-icmp-block=icmptype [--timeout=seconds]:添加ICMP類型。如果指定了timeout,則在時間範圍內有效;時間過後,則失效。[--permanent] [--zone=zone] --remove-icmp-block=icmptype:去掉ICMP類型。[--permanent] [--zone=zone] --query-icmp-block=icmptype:查詢ICMP是否存在,如果存在則返回0,否則返回1。[--permanent] [--zone=zone] --list-forward-ports:羅列出IPv4中所有的流量轉出的連接埠。[--permanent] [--zone=zone] --add-forward-port=port=portid[-portid]:proto=protocol[:toport=portid[-portid]][:toaddr=address[/mask]][--timeout=seconds]:增加IPv4中流量轉出的連接埠設定。[--permanent] [--zone=zone] --remove-forward-port=port=portid[-portid]:proto=protocol[:toport=portid[-portid]][:toaddr=address[/mask]]:去掉IPv4中流量轉出的連接埠設定。[--permanent] [--zone=zone] --query-forward-port=port=portid[-portid]:proto=protocol[:toport=portid[-portid]][:toaddr=address[/mask]]:查詢流量轉出的連接埠設定是否存在。如果存在返回0,如果不存在則返回1。[--permanent] [--zone=zone] --add-masquerade [--timeout=seconds]:增加偽裝地址。[--permanent] [--zone=zone] --remove-masquerade:去掉偽裝地址。[--permanent] [--zone=zone] --query-masquerade:查詢偽裝地址。[--permanent] [--zone=zone] --list-rich-rules:羅列出所有的富規則。[--permanent] [--zone=zone] --add-rich-rule='rule' [--timeout=seconds]:增加富規則。[--permanent] [--zone=zone] --remove-rich-rule='rule':去掉富規則。[--permanent] [--zone=zone] --query-rich-rule='rule':查詢富規則。[--permanent] [--zone=zone] --list-interfaces:羅列所有的網卡。[--permanent] [--zone=zone] --add-interface=interface:增加網卡。[--zone=zone] --change-interface=interface:修改地區中的網卡。[--permanent] [--zone=zone] --query-interface=interface:查詢網卡。[--permanent] [--zone=zone] --remove-interface=interface:去掉網卡。[--permanent] [--zone=zone] --list-sources:羅列所有的源[--permanent] [--zone=zone] --add-source=source[/mask]:添加源目標。[--zone=zone] --change-source=source[/mask]:修改源目標。[--permanent] [--zone=zone] --query-source=source[/mask]:查詢源目標,如果存在放回0,否則返回1。[--permanent] [--zone=zone] --remove-source=source[/mask]:去掉源目標。[--permanent] --direct --get-all-chains:擷取所有的鏈。[--permanent] --direct --get-chains { ipv4 | ipv6 | eb } table:擷取資料表中的鏈。資料表之間使用空格分隔。[--permanent] --direct --add-chain { ipv4 | ipv6 | eb } table chain:增加一個鏈到資料表中。[--permanent] --direct --remove-chain { ipv4 | ipv6 | eb } table chain:從資料表去掉一個鏈。[--permanent] --direct --query-chain { ipv4 | ipv6 | eb } table chain:檢查一個鏈是否在資料表中。如果在,返回0;否則返回1。[--permanent] --direct --get-all-rules:擷取所有的規則。[--permanent] --direct --get-rules { ipv4 | ipv6 | eb } table chain:擷取資料表中所有規則。[--permanent] --direct --add-rule { ipv4 | ipv6 | eb } table chain priority args:為資料表中的鏈添加規則,並定義優先權。[--permanent] --direct --remove-rule { ipv4 | ipv6 | eb } table chain priority args:去掉資料表中鏈的規則。[--permanent] --direct --remove-rules { ipv4 | ipv6 | eb } table chain:去掉資料錶鏈的規則。[--permanent] --direct --query-rule { ipv4 | ipv6 | eb } table chain priority args:查詢規則是否在資料表的鏈中。--direct --passthrough { ipv4 | ipv6 | eb } args:給防火牆傳遞一個命令。--permanent --direct --get-all-passthroughs:擷取所有的命令。--permanent --direct --get-passthroughs { ipv4 | ipv6 | eb }:擷取合格命令。--permanent --direct --add-passthrough { ipv4 | ipv6 | eb } args:增加合格命令。--permanent --direct --remove-passthrough { ipv4 | ipv6 | eb } args:去掉某些條件的命令。--permanent --direct --query-passthrough { ipv4 | ipv6 | eb } args:查詢某些條件的命令是否存在。--lockdown-on:使鎖功能可用。--lockdown-off:使鎖功能不可用。-query-lockdown:查詢鎖功能是否可用。[--permanent] --list-lockdown-whitelist-commands:羅列出可以修改防火牆規則的主體的白名單。[--permanent] --add-lockdown-whitelist-command=command:添加可以修改防火牆規則的主體的白名單。[--permanent] --remove-lockdown-whitelist-command=command:去掉可以修改防火牆規則的主體的白名單。[--permanent] --query-lockdown-whitelist-command=command:查詢白名單是否在可以修改防火牆規則的主體的白名單中。[--permanent] --list-lockdown-whitelist-contexts:羅列出所有白名單中配置了的selinuxcontenxt。[--permanent] --add-lockdown-whitelist-context=context:添加一個selinuxcontenxt。[--permanent] --remove-lockdown-whitelist-context=context:去掉一個selinuxcontenxt。[--permanent] --query-lockdown-whitelist-context=context:查詢selinuxcontenxt是否存在。[--permanent] --list-lockdown-whitelist-uids:羅列白名單中的所有使用者ID。[--permanent] --add-lockdown-whitelist-uid=uid:添加使用者ID到白名單中。[--permanent] --remove-lockdown-whitelist-uid=uid:去掉白名單中的使用者ID。[--permanent] --query-lockdown-whitelist-uid=uid:查詢使用者ID是否存在於白名單中。[--permanent] --list-lockdown-whitelist-users:羅列白名單中的所有使用者名稱稱。[--permanent] --add-lockdown-whitelist-user=user:添加使用者名稱稱到白名單中。[--permanent] --remove-lockdown-whitelist-user=user:去掉白名單中的使用者名稱稱。[--permanent] --query-lockdown-whitelist-user=user:查詢使用者名稱稱是否存在於白名單中。--panic-on:開啟應急模式。--panic-off:關閉應急模式。--query-panic:查詢應急模式是否可用。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.