我试图设置一个firewalld规则将80 / tcp转发到8080-8081,规则设置正确,但似乎只是部分工作。
问题是流量总是转发到8080而不是8081,有什么不对吗?
以下是我的环境:
设置firewalld规则以执行前移端口
firewall-cmd --add-forward-port =' port = 80:proto = tcp:toport = 8080-8081' --permanent
curl http://192.168.30.30:80(始终转发到端口8080)
下面是我的firewalld设置:
firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens160
sources:
services: ssh dhcpv6-client
ports: 80/tcp
protocols:
masquerade: yes
forward-ports: port=80:proto=tcp:toport=8080-8081:toaddr=
source-ports:
icmp-blocks:
rich rules:
sysctl -a | grep ip_forward
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0