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=""]
[ source address="" [invert "True"] ]
[ destination address="" [invert="True"] ]
[ ]
[ log [prefix=""] [level=""] [limit value="rate/duration"] ]
[ audit ]
[ acceptlrejectldrop ]
选项 | 说明 |
---|---|
-add-rich-rule= 'RULE' | 向指定区域中添加RULE,如果没有指定区域,则为默认区域 |
--remove-rich-rule= 'RULE' | 从指定区域中删除RULE,如果没有指定区域,则为默认区域 |
--query-rich-rule= 'RULE' | 查询RULE是否已添加到指定区域,如果未指定区域,则为默认区域。 规则存在,则返回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