Skip to contentSkip to conversation

Multiple SNAT source address ranges

DISCUSSION Kirk Hoganson 2 participants 2 messages Sep 2, 2005 – Sep 6, 2005

lore
Share & tools
lore
#0 lore raw

I am attempting to create SNAT rules that will round-robin through a series of addresses from different ranges as per the man page. Apparently I am making mistakes with the syntax, as running my script results in some errors. Can someone tell me how I need to structure these rules? Here are some examples of what I have tried:

$IPTABLES -t nat -A POSTROUTING -o $EXT -m state --state NEW -p tcp --dport 80 -j SNAT --to-source 24.28.18.56 --to-source 24.28.18.57 --to-source 24.28.18.58

Or:

$IPTABLES -t nat -A POSTROUTING -o $EXT -m state --state NEW -p tcp --dport 80 -j SNAT --to-source 24.28.18.56-24.28.18.63 --to-source 16.7.15.32-16.7.15.39 --to-source 16.7.87.64-16.7.87.71

How do I specify more than one source address from seperate ranges?