iptables -t nat -A POSTROUTING -o eth0 -m state --state NEW -m statistic --mode random --probability 0.33 -j SNAT --to 192.168.1.3
iptables -t nat -A POSTROUTING -o eth0 -m state --state NEW -m statistic --mode random --probability 0.33 -j SNAT --to 192.168.1.6
iptables -t nat -A POSTROUTING -o eth0 -m state --state NEW -j SNAT --to 192.168.1.9
復(fù)制代碼
在這個(gè)例子中,我們使用了 --mode random 參數(shù)來選擇隨機(jī)的 IP 地址,--probability 參數(shù)用于指定每個(gè) IP 地址被選中的概率。你可以根據(jù)自己的需求調(diào)整概率值,以確保每個(gè) IP 地址被選中的概率是相等的。作者: baby_神 時(shí)間: 2023-03-07 14:02
iptables -t nat -A POSTROUTING -o eth0 -m state --state NEW -m statistic --mode nth --every 3 --packet 0 -j SNAT --to-source 192.168.1.3
iptables -t nat -A POSTROUTING -o eth0 -m state --state NEW -m statistic --mode nth --every 3 --packet 1 -j SNAT --to-source 192.168.1.6
iptables -t nat -A POSTROUTING -o eth0 -m state --state NEW -m statistic --mode nth --every 3 --packet 2 -j SNAT --to-source 192.168.1.9