---
title: Network configuration with Netplan on Ubuntu on a Scaleway Dedibox
description: This page shows how to configure netplan on Ubuntu on a Scaleway Dedibox
tags: dedibox network netplan ubuntu
dates:
  validation: 2025-09-09
  posted: 2021-08-20
---
import Requirements from '@macros/iam/requirements.mdx'


Since the release of its version 18.04, Bionic Beaver, [Ubuntu](http://www.ubuntu.org) has switched to [Netplan](http://netplan.io) for the network interface configuration. It is a [YAML](https://yaml.org/spec/1.2/spec.html) based configuration system, which simplifies the configuration process.

<Requirements />

- A Dedibox account logged into the [console](https://console.online.net)
- [Created](/dedibox/how-to/order-a-server/) and [installed](/dedibox/how-to/install-a-server/) a dedicated server

## Configuration files

This tool replaces the `/etc/network/interfaces` configuration file previously used to configure the network interfaces on Ubuntu.

The configuration files are now YAML files located in `/etc/netplan/*.yaml`.


<Message type="important">
  Make sure you respect the YAML standards when you edit the file, as syntax errors might cause errors in your configuration.
</Message>


The `01-netcfg.yaml` file is used to configure the first interface. Below, you can find the default configuration for an interface using DHCP:

```
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0f0:
      dhcp4: yes
```


Following, you can see a list of the most common configuration options and a description of how they are used.

|  Option  | Example | Description |
| :--------  | :-------- | :---------- |
| addresses| 192.168.1.2/24, 62.210.123.123/32 | A list of IP addresses to be assigned to an interface. The format uses CIDR notation.        |
| gateway4    | 192.168.1.1     | The IP address of your local IPv4 gateway.        |
| dhcp4    | true     | Set whether DHCP is enabled for IPv4 – true of false        |
| dhcp6    | true     | Set whether DHCP is enabled for IPv6 – true or false        |


## Configuring a failover IP with Netplan

To configure a failover IP, you must edit the file `/etc/netplan/01-netcfg.yaml` and configure static networking for your server. The IP addresses have to be written with their [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation). The netmask is `/24` for the principal IP of the server and `/32` for each failover IP. Your configuration file should look like in the following example:

```
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0f0:
      addresses: [163.172.123.123/24, 212.83.123.123/32]
      gateway4: 163.172.123.1
      nameservers:
        addresses: [ "51.159.47.28", "51.159.47.26" ]
```

<Message type="tip">
  Replace the DNS cache servers in the example above (`51.159.47.28` and `51.159.47.26`) with the nameservers [available in the same data center](/account/reference-content/scaleway-network-information/#dns-cache-servers-and-ntp-servers) as your server for optimal latency.
</Message>

Once you have edited and saved the file, you can reload the configuration with the following command:

```
sudo netplan apply
```

## Configuring a failover IP for virtual machines

When configuring a failover IP in a virtual machine, you must specify which route will be used by the VM. Your configuration file should look like the following example:

```
    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/account/reference-content/scaleway-network-information/#dns-cache-servers-and-ntp-servers/)
            routes:
            -   to: default
                via: 62.210.0.1
            -   to: 62.210.0.1/32
                via: fail.over.ip.address
                scope: link
    version: 2
```

<Message type="tip">
  Replace the DNS cache servers in the example above (`51.159.47.28` and `51.159.47.26`) with the nameservers [available in the same data center](/account/reference-content/scaleway-network-information/#dns-cache-servers-and-ntp-servers) as your server for optimal latency.
</Message>