Changes

Jump to: navigation, search

Using NAT for container with private IPs

416 bytes added, 00:17, 7 January 2009
no edit summary
<pre>
# iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to ip_address
</pre>
 
If you are using an iptables firewall (for example the default RedHat/CentOS firewall), don't forget to allow outgoing connections from your containers. For example if you are using the subnet 172.16.150.0/24 for your VMs, you should do the following:
<pre>
# /sbin/iptables -A RH-Firewall-1-INPUT -s 172.16.149.0/24 -j ACCEPT
# /sbin/iptables-save > /etc/sysconfig/iptables
# /sbin/service iptables restart
</pre>
5
edits

Navigation menu