firewall-cmd --zone=external --add-forward-port=\ port=3389:proto=tcp:toport=3389:toaddr=10.10.10.1 允许192.168.50.17的主机通过ssh访问防火墙 firewall-cmd --zone=external --add-rich-rule="rule \ family="ipv4" \ source address="192.168.50.17" \ service name="ssh" \ log prefix=\"ssh ...
firewall-cmd --add-forward-port=port=8888:proto=udp:toport=53 --permanent #永久将本机默认网络区下的本地UDP8888端口转发到本地UDP53端口上。 firewall-cmd --add-forward-port=port=7777:proto=tcp:toport=6667:toaddr=192.168.1.160 --zone=public #临时在public网络区下将本机7777端口的TCP流量转发...
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 ! -s 172.25.254.250 -p tcp --dport 22 -j REJECT 6.firewalld中的NAT SNAT firewall-cmd --permanent --add-masquerade #打开地址伪装 firewall-cmd --reload #重启服务 DNAT firewall-cmd --add-forward-port=port=22:proto=tcp:toport=2...
firewall-cmd --zone=trusted --add-source=10.8.98.100 --permanent firewall-cmd --reload firewall-cmd --list-all-zones 需求2:只允许某一个ip访问服务器的1521端口。 firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.8.98.7/32" port protocol="tcp" port="1521...
[root@web02 ~]# firewall-cmd --add-rich-rule='rule family=ipv4 source address=10.0.0.1 forward-port port=5555 protocol=tcp to-port=22 to-addr=172.16.1.7'success [root@web02~]# firewall-cmd --add-masquerade success 5.防火墙配置网站禁ping ...
# firewall-cmd –list-all dmz target: default icmp-block-inversion: no interfaces: sources: services: http https imap imaps pop3 pop3s smtp smtps ports: 7022/tcp protocols: masquerade: no forward-ports: sourceports: icmp-blocks: rich rules: ...
firewall-cmd --permanent --remove-rich-rule 'rule family="ipv4" source address="0.0.0.0/0" forward-port port="8077" protocol="tcp" to-port="80" to-addr="192.168.4.245"' 下面是示例操作: #显示规则列表[root@new-center~]# firewall-cmd--list-rich-rules rule family="ipv4"source address...
# firewall-cmd --get-default-zone public # firewall-cmd --get-zone-of-interface=ens33 public 修改网卡关联的区域 方法1:先删除现有关联区域,再添加目标关联区域(因为同一时间,一张网卡只能关联一个区域,所以要先添加再删除) # firewall-cmd --remove-interface=ens33 --zone=public ...
firewall-cmd --zone=external --add-forward-port=\ port=3389:proto=tcp:toport=3389:toaddr=10.10.10.1 允许192.168.50.17的主机通过ssh访问防火墙 firewall-cmd --zone=external --add-rich-rule="rule \ family="ipv4" \ source address="192.168.50.17" \ ...
firewall-cmd --permanent --add-rich-rule="rule priority="100" family="ipv4" port protocol="tcp" port="22" reject" # 允许192.168.109.1的地址访问22端口,优先级10。 端口支持单个也支持区间port="2222-3333" firewall-cmd --permanent --add-rich-rule="rule priority="10" family="ipv4" source...