iptables的udp负载均衡记录

iptables的udp负载均衡记录, 最近才学习这些东西,尝试kcptun的随机端口测试用。

客户端client:

iptables -t nat -A OUTPUT -p udp –dport 4444 -m state –state NEW -m statistic –mode nth –every 4 –packet 0 -j DNAT –to-destination 127.0.0.1:1444

iptables -t nat -A OUTPUT -p udp –dport 4444 -m state –state NEW -m statistic –mode nth –every 4 –packet 1 -j DNAT –to-destination 127.0.0.1:1445

iptables -t nat -A OUTPUT -p udp –dport 4444 -m state –state NEW -m statistic –mode nth –every 4 –packet 2 -j DNAT –to-destination 127.0.0.1:1446

iptables -t nat -A OUTPUT -p udp –dport 4444 -m state –state NEW -m statistic –mode nth –every 4 –packet 3 -j DNAT –to-destination 127.0.0.1:1447

服务端server:

iptables -t nat -A OUTPUT -p udp –dport 1445:1447 -j DNAT –to-destination 127.0.0.1:5555

另外要kcptun客户端需要设置:

“conn”: 4,
“autoexpire”: 0,

kcptun要设置端口到4444去

kcptun server端要设置端口到5555去

关于无聊人

一个无聊人而已
此条目发表在技术生活分类目录。将固定链接加入收藏夹。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注