Changes

Jump to: navigation, search

Using NAT for container with private IPs

220 bytes added, 12:58, 28 July 2008
Added example of IP range specification.
</pre>
where <tt>src_net</tt> is a range of IP addresses of containers to be translated by SNAT, and <tt>ip_address</tt> is the external IP address of your [[Hardware Node]]. The format of src_net is xx.xx.xx.xx/xx. For example to specify IP addresses from 192.168.2.12 through 192.168.2.25 use:<pre># iptables -t nat -A POSTROUTING -s 192.168.2.12/25 -o eth0 -j SNAT --to ip_address</pre> Multiple rules are allowed, for example, in case you wish to specify several ranges of IP addresses. If you are using a number of physical network interfaces on the [[Hardware Node|Node]], you may need to specify a different interface for outgoing connections, e.g. <tt>-o eth2</tt>.
To make all IP addresses to be translated by SNAT (not only the ones of [[container]]s with private addresses), you should type the following string:
66
edits

Navigation menu