NavigationContentFooter
Jump toSuggest an edit

How to configure the network of a virtual machine on a Dedibox host

Reviewed on 22 July 2024Published on 29 July 2021

When you install your server with a virtualization solution like Proxmox, you can create multiple virtual machines on the physical server. This setup allows you to have separate environments for different services (e.g., mail and web services) or to optimize the server’s performance by running several virtual machines.

To communicate on the internet, each of your virtual machines needs an IP address. You can use failover IPs to have additional IP addresses available for your server.

Tip

You can configure a unique gateway for your virtual machines, allowing them to move between hypervisors without changing their network configuration.

  • IP address of the unique gateway: 62.210.0.1

Before you start

To complete the actions presented below, you must have:

  • A Dedibox account logged into the console
  • Created a Dedibox dedicated server and installed a hypervisor on it
  • Ordered a failover IP
  • Generated a virtual MAC address

Find below examples of network interface configurations on different distributions inside a virtual machine:

Ubuntu

Since the release of version 18.04 (Bionic Beaver), Ubuntu has used Netplan for configuring network interfaces. For older releases, refer to the Debian configuration.

  1. Log into your virtual machine and open the network configuration file /etc/netplan/01-netcfg.yaml in a text editor of your choice, for example nano:
    sudo nano /etc/netplan/01-netcfg.yaml
  2. Create a network configuration as follows. Replace fail.over.ip.address with your failover IP address:
    network:
    ethernets:
    ens18:
    addresses:
    - [ "fail.over.ip.address/32" ]
    nameservers:
    addresses: [ "51.159.47.28", "51.159.47.26" ] # Replace the IP of the DNS cache server with the one located in the same physical location as your machine for optimal performances (https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#dns-cache-servers)
    routes:
    - to: default
    via: 62.210.0.1
    - to: 62.210.0.1/32
    via: fail.over.ip.address
    scope: link
    version: 2
  3. Save the file and exit the text editor.
  4. Apply the new configuration:
    sudo netplan apply

Debian

  1. Log into the virtual machine and edit the file /etc/network/interfaces with a text editor of your choice, for example, nano:
    sudo nano /etc/network/interfaces
  2. Configure the network interface as follows. Replace fail.over.ip.address with your failover IP address:
    auto eth0
    iface eth0 inet static
    address fail.over.ip.address
    netmask 255.255.255.255
    pointopoint 62.210.0.1
    gateway 62.210.0.1
  3. Save the file and exit the text editor.
  4. Set the DNS server information by editing the file /etc/resolv.conf:
    sudo nano /etc/resolv.conf
  5. Set the DNS resolver by adding the following lines to the file. Then save it and exit the text editor:
    nameserver 51.159.47.28
    nameserver 51.159.47.26
    Tip

    Replace the IP of the DNS cache server with the one located in the same physical location as your machine for optimal performance. Check the IPs for each datacenter

  6. Activate the network on your virtual machine by running:
    sudo ifup eth0

CentOS

  1. Log into the virtual machine and edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 with a text editor of your choice, for example, nano:
    sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
  2. Configure the network interface as follows. Replace fail.over.ip.address with your failover IP address and virtual:mac:address with the virtual MAC of the VM:
    DEVICE=eth0
    BOOTPROTO=none
    ONBOOT=yes
    USERCTL=no
    IPV6INIT=no
    PEERDNS=yes
    TYPE=Ethernet
    NETMASK=255.255.255.255
    IPADDR=fail.over.ip.address
    GATEWAY=62.210.0.1
    DNS1=51.159.47.28 # Replace the IP of the DNS cache server with the one located in the same physical location as your machine for optimal performances (https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#dns-cache-servers)
    DNS2=51.159.47.26
    ARP=yes
    HWADDR=virtual:mac:address
  3. Save the file and close the text editor.
  4. Edit the file /etc/sysconfig/network-scripts/route-eth0 as follows, then save and exit the text editor:
    62.210.0.1 dev eth0
    default via 62.210.0.1 dev eth0
  5. Run the following command to bring the network interface up:
    sudo ifup eth0

Windows Server

  1. Connect to the desktop of your VM in the virtual console, then open the network settings of your server.

  2. Enter the following information in the network adapter configuration:

    • Address: failover IP
    • Subnetmask: 255.255.255.255
    • Gateway: 62.210.0.1
    • DNS 1: 51.159.47.28
    • DNS 2: 51.159.47.26
    Tip

    Replace the IP of the DNS cache server with the one located in the same physical location as your machine for optimal performance. Check the IPs for each datacenter

See also
How to configure a multi-IP virtual MAC address group
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway