UDP 的 Nginx 直接服务器 Return
Nginx Direct Server Return for UDP
我正在使用此资源 (https://www.nginx.com/blog/ip-transparency-direct-server-return-nginx-plus-transparent-proxy/) 设置 UDP 负载平衡器,使用 DSR 和源 NAT。
演练中的一切都很顺利,直到我到达交通管制处:
tc qdisc add dev eth0 root handle 10: htb
tc filter add dev eth0 parent 10: protocol ip prio 10 u32 match ip src 172.16.0.11 match ip sport 53 action nat egress 172.16.0.11 192.168.99.10
第二个命令失败:
Illegal "match"
从我在这里读到的内容 (http://man7.org/linux/man-pages/man8/tc-u32.8.html) 来看,语法看起来是正确的。
当然,我将 172.16.0.11 替换为我正在配置的上游的实际 IP,将 192.168.99.10 替换为托管 Nginx 的主机的 IP。接口名称是 eth0.
我是 运行 Ubuntu 16.04.02 LTS。
是"tc filter"命令不正确,还是我做错了什么?使用 IPVS 会更简单吗?
谢谢!
我已经使用 0xffff 掩码来接受所有范围。
tc filter add dev eth0 parent 10: protocol ip prio 10 u32 match ip src 172.16.0.11 match ip sport 53 0xffff action nat egress 172.16.0.11 192.168.99.10
我正在使用此资源 (https://www.nginx.com/blog/ip-transparency-direct-server-return-nginx-plus-transparent-proxy/) 设置 UDP 负载平衡器,使用 DSR 和源 NAT。
演练中的一切都很顺利,直到我到达交通管制处:
tc qdisc add dev eth0 root handle 10: htb
tc filter add dev eth0 parent 10: protocol ip prio 10 u32 match ip src 172.16.0.11 match ip sport 53 action nat egress 172.16.0.11 192.168.99.10
第二个命令失败:
Illegal "match"
从我在这里读到的内容 (http://man7.org/linux/man-pages/man8/tc-u32.8.html) 来看,语法看起来是正确的。 当然,我将 172.16.0.11 替换为我正在配置的上游的实际 IP,将 192.168.99.10 替换为托管 Nginx 的主机的 IP。接口名称是 eth0.
我是 运行 Ubuntu 16.04.02 LTS。
是"tc filter"命令不正确,还是我做错了什么?使用 IPVS 会更简单吗?
谢谢!
我已经使用 0xffff 掩码来接受所有范围。
tc filter add dev eth0 parent 10: protocol ip prio 10 u32 match ip src 172.16.0.11 match ip sport 53 0xffff action nat egress 172.16.0.11 192.168.99.10