This article describes how to configure the system to create virtual machines in a local network with access to the Internet.
Cluster configuration algorithm:
- To add the IP pool of the local network in Settings → IP pool or in IPmanager . Reserve the IP addresses from that subnet for the cluster nodes;
-
Configure the IP address from the local network on the cluster nodes:
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-vmbr0:0 IPADDR=<IP-address> NETMASK=<network mask> EOF
View details -
Restart the network on the cluster nodes:
service network restart
-
Check the connection between the cluster nodes:
ping <cluster node IP address>
-
To configure the NAT on the master node, edit the /etc/sysconfig/iptables file and add the following line into *nat:
-A POSTROUTING -s <local network> ! -d <IP-address> -o vmbr0 -j MASQUERADE
View details -
Restart iptables:
service iptables restart
After you configure the system, you can create virtual machines with the IP addresses from the pool. The machines will have access to the Internet, but they won't be accessible from the outside.