Page tree
Skip to end of metadata
Go to start of metadata

IP address management allows you to choose your required private IPv4 address when deploying a server. This requires the following configuration:

  1. Create a public network. For information on how to do this, see Creating a Network
  2. Create a private network. For information on how to do this, see Creating a Network.
  3. Add a subnet of the appropriate size to the private network. For information on how to do this, see Managing a Network. Ensure you note the size of the subnet.
  4. Create a virtual machine to act as a gateway for the virtual machines on the private network. This should initially be connected to the public network. For information on how to do this, see Creating a Server

    Do not start the server until you have completed the next step.

  5. Manage the server and add a NIC to it. Attach this NIC to the private network. For information on how to do this, see Managing a Server.
  6. Start the server. Once it has booted, open a console to it and log in. 
  7. Create /etc/network/interfaces.d/eth1.cfg and add the following to it: 

    auto eth1
    iface eth1 inet static
    address [address on private network] ## we recommend that this is the first usable address in the subnet.
    netmask [netmask of subnet on private network] ## this should be given in octets, for example if you have added a /29 subnet, your netmask should be 255.255.255.248 
  8. Save the eth1.cfg file.

  9. On the command line of the gateway virtual machine, run the following commands: 

    echo "1" > /proc/sys/net/ipv4/ip_forward && iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  10. Hyper-V and VMware clusters require the following additional configuration:

    1. Run the following commands:

      sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED && sudo  iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
    2. Install the iptables-persistent package with the default configuration options.

    3. Save the iptables rules using the following command: 

      iptables-save > /etc/iptables/rules.v4
  11. Run the following command:

    ifup eth1


    Your gateway is now configured; IPv4 addresses from the private subnet can be assigned to any virtual machines added to the private network. 

  • No labels