This article describes how to configure the system to create virtual machines in a local network with access to the Internet.

Cluster configuration algorithm:

  1. 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; 
  2. 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
    BASH

    vmbr0 — virtual network bridge name.

    <IP-address> — IP addresses from the local network.

    <network mask> — network mask.

  3. Restart the network on the cluster nodes:

    service network restart
    BASH
  4. Check the connection between the cluster nodes:

    ping <cluster node IP address>
    BASH
  5. 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
    BASH

    <local network> — enter as "network address / mask".

    <IP address> — the public IP on the master node.

    vmbr0 — the name of the virtual network bridge.

  6. Restart iptables:

    service iptables restart
    BASH

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.