IP地址假裝(masquerade)網絡
firewall-cmd [--permanent] [--zone= zone] --add-masquerade [--timeout seconds] //--timeout=seconds:在一段時間後自動刪除該功能
firewall-cmd [--permanent] [--zone= zone] --remove-masquerade
firewall-cmd [--permanent] [--zone=zone] --query-masquerade
firewall-cmd [--permanent] [--zone=zone] --list-forward-ports
firewall-cmd [--permanent] [--zone=zone] --add-forward-port=port=portid[-portid]:proto=protocol[:toport-portid[-portid]][:toaddr-address[/mask]][--timeout=seconds]
firewall-cmd [--permanent] [--zone=zone] --remove-forward-port=port=portid[-portid]:proto=protocol[:toport=portid[-portid]][:toaddr=address[/mask]]
firewall-cmd [--permanent] [--zone=zone] --query-forward-port-port-portid[-portid]:proto=protocol[:toport-portid[-portid]][:toaddr=address[/mask]]
irewall-cmd --direct --add-rule ipv4 filter IN work_ allow 0 -p tcp --dport 9000 j ACCEPT
firewall-cmd --direct --get-all-rules ipv4 filter IN_ work _allow 0 -p tcp --dport 9000 -j ACCEPT
rule [family="<rule family>"] [ source address="<address>" [invert "True"] ] [ destination address="<address>" [invert="True"] ] [ <element> ] [ log [prefix="<prefix text>"] [level="<log level>"] [limit value="rate/duration"] ] [ audit ] [ acceptlrejectldrop ]
選項 | 說明 |
---|---|
-add-rich-rule= 'RULE' | 向指定區域中添加RULE,若是沒有指定區域,則爲默認區域 |
--remove-rich-rule= 'RULE' | 從指定區域中刪除RULE,若是沒有指定區域,則爲默認區域 |
--query-rich-rule= 'RULE' | 查詢RULE是否已添加到指定區域,若是未指定區域,則爲默認區域。<br/>規則存在,則返回0,不然返回1 |
--list-rich-rules | 輸出指定區域的全部富規則,若是未指定區域,則爲默認區域 |
firewall-cmd --permanent --zone=work --add-rich-rule='rule family=ipv4 source address=192.168.8.101/32 reject'
firewall-cmd --permanent --one=work --add-rich-rule='rule family=ipv4 source address=192.168.1.0/24 port port=8000-9000 protocol=tcp accept'
firewall-cmd --permanent --add-rich-rule='rule protocol value=icmp drop'
firewall-cmd --add-rich-rule='rule family=ipv4 source address=192.168.8.1/32 service name="http" log level=notice prefix= "NEW HTTP」limit value "3/s" accept'
Apr 16 17:09:55 Server kernel: NEW HTTP IN=ens33 OUT= MAC=00:0c:29:69:01:c4:00:50:56:c0:00:08:08:00 SRC=192.168.8.1 DST=192.168.8.131 LEN=52 TOS=0xOO PREC=0x00 TTL =64 ID=20582 DF PROTO=TCP SPT=65289 DPT=80 WINDOW=8192 RES=0x00 SYN URGP=0 Apr 16 17:09:55 Server kernel: NEW HTTP IN=ens33 OUT= MAC=00:0c:29:69:01:c4:00:50:56:c0:00:08:08:00 SRC=192.168.8.1 DST=192.168.8.131 LEN=52 TOS=0x0O PREC=0x0O TTL =64 ID=20590 DF PROTO=TCP SPT=65291 DPT=80 WINDOW=8192 RES=0x00 SYN URGP=0 Apr 16 17:09:55 Server kernel: NEW HTTP IN=ens33 OUT= MAC=00:0c:29:69:01:c4:00:50:56:c0:00:08:08:00 SRC=192.168.8.1 DST=192.168.8.131 LEN=52 TOS=0x0O PREC=0x0O TTL =64 ID=20602 DF PROTO=TCP SPT=65292 DPT=80 WINDOW=8192 RES=0x00 SYN URGP=0