December 2000
Intermediate to advanced
800 pages
22h 41m
English
Masquerading, as we have previously discussed it, is just a special case of source NAT. If you happen to have a public, static IP, you don't want masquerading—what you want is source network address translation (SNAT). You'll want to use SNAT instead of masquerading where possible for some of the features SNAT brings, including mapping your hosts to multiple IP addresses.
Looking at a few examples and their explanations might help your understanding:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 209.127.112.150
The preceding line says you want to use the NAT table (-t nat) and append to the POSTROUTING chain. You're going to use the outgoing interface eth0 (this is the Internet- connected interface) and change the source address of ...
Read now
Unlock full access