---
title: 'netplan as a replacement for /etc/network/interfaces'
url: 'https://ra1ahq.blog/en/netplan-kak-zamena-etc-network-interfaces'
markdown: 'https://ra1ahq.blog/en/netplan-kak-zamena-etc-network-interfaces.md'
lang: en
date: '2023-11-03'
description: 'How to configure a network using the interfaces file outdated. Home The netplan utility is used for network configuration. It converts a YAML'
taxonomy:
  category:
    - blog
  tag:
    - Linux
  archives_month:
    - nov_2023
  archives_year:
    - '2023'
---

# netplan as a replacement for /etc/network/interfaces

3 

 November 

 2023 

 15:25

### netplan as a replacement for /etc/network/interfaces

 [Linux](https://ra1ahq.blog/en/tag:Linux) 

3 November 2023 15:25

How to configure a network using the interfaces file [outdated](https://ra1ahq.blog/en/staticheskii-ip-adres-v-ubuntu-i-linux-mint-nastroika).

### Home

The netplan utility is used for network configuration. It converts a YAML (Structured Text File) format configuration file into settings for the SystemD network service, the systemd-networkd service.
Netplan was introduced in Ubuntu 18.04 "Bionic Beaver" in 2017, then it gradually came into use: it is present in OS 20.04 "Focal Fossa". Ubuntu 22.04 "Jammy Jallyfish" and Linux Mint 21.2 "Victoria" have netplan enabled by default. Moreover, the /etc/network/interfaces file is missing if you did not upgrade the version using **sudo do-release-upgrade**(from the package `update-manager-core`) or **sudo mintupgrade**(from the package of the same name).

The Netplan configuration may not always be used on desktop operating systems, but is always used on server versions of the Ubuntu OS starting from 22.04. The fact is that disabling netplan requires intervention in the kernel parameters (there is information on the Internet about ways to disable netplan).

On desktop PCs, by default, netplan delegates network management to NetworkManager (see "Default natplan configuration" below).

For netplan to work, you need OS version 18.04 and higher. In versions 18.04 and 20.04, to work with a configuration different from the standard one, you need to force the systemd-networkd network service to start. (In 22.04 it starts after the default installation).

```
sudo systemctl start systemd-networkd
sudo systemctl enable systemd-networkd
```

Running the systemd-networkd service for netplan to work is required to work with configurations for dynamic distribution of DHCP and static IP addresses, and other options described in **\*config.yaml**.

### 1. Netplan default configuration

When using systemd-networkd, the /etc/network/interfaces configuration is no longer accepted and this file may not be present in the system.

The configuration in the form of a yaml file is located in the folder **/etc/netplan**.

On a clean installation of a system, such as Linux Green, netplan is configured to transfer control of settings **graphical component NetworkManager**(configured using an applet in the system tray on the taskbar).

Netplan default configuration:

File **/etc/netplan/1-network-manager-all.yaml:**

```
#Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
```

Applying the configuration using the command:

```
sudo netplan apply
```

### 2. Netplan configuration for DHCP

To configure the configuration using netplan files rather than the NetworkManager GUI, you need to in the directory `/etc/netplan/` in the YAML file the line "renderer" from "*NetworkManager*" to "*networked*". In this case, the "NetworkManager" applet in the system tray loses the ability to manage the network and shows the "broken connection" icon, regardless of whether there is a network or not.

If the network uses dynamic IP addresses, the DHCP service is configured on the router, and the following netplan configuration is used on the client:

File **/etc/netplan/00-installer-config.yaml**for DHCP

```
network:
renderer: networkd
ethernets:
    enp1s10:
      dhcp4: true
version: 2
```

where the name of the network card is enp1s10 in my case (external network card), and for built-in ones it can be enp1s0 and enp2s0.
If the router can also distribute IP addresses using the IPv6 protocol, below `dhcp4: true` пишем `dhcp6: true` with the same indentation (tab characters or spaces are important)!

Application configuration:

```
sudo netplan apply
```

### 3. Netplan configuration for static IP address

Indentation in a file matters a lot. Below is an example of a correct netplan configuration file for a static IP address.

File **/etc/netplan/000-installer-config.yaml** for static IP address:

```
network:
renderer: networkd
ethernets:
    enp1s10:
      dhcp4: false
      dhcp6: false
      optional: false
      addresses: [192.168.1.2/24]
      nameservers:
        addresses: [192.168.1.1,8.8.8.8]
      routes:
        - to: default
          via: 192.168.1.1
          metric: 100
version: 2
```

Where:

- optional = false the device is not needed to boot
- optional = true the device is required to boot.
    If a device is marked as optional, the networkd service will not wait for it.
    The default value is false.
- addresses - may include multiple IP addresses, for example, \[192.168.14.2/24, "2001:1::2/64"\]

The gateway4 and gateway6 configuration parameters are deprecated; instead, "Default routes" of the following form are used:

```

      routes:
        - to: default
          via: 192.168.1.1
          metric: 100
```

Don't forget to apply the configuration:

```
sudo netplan apply
```

To check the network configuration to decide whether it is correct, you need to use *try* instead of *apply*. The user is given 120 seconds to check the network operation. If you press Ctrl+C or the timeout expires, the configuration will be cancelled. To apply the configuration, press Enter.

### 4. Installing netplan on Debian

(Addendum dated November 4, 2023):

```
su -
apt update
apt install netplan
```

### 5. How can I programmatically find out which network management mechanism is being used?

You can determine the use of netplan with the commands:

systemctl status systemd-networkd
(Checking the status of the systemd-networkd service).

```
cat /run/network/ifstate
```

(For netplan it will be lo=lo).

### Setting up a network using NetworkManager

If the file /etc/netplan/\*.yaml *points* to the graphical utility NetworkManager, then the current network settings need to look at the configuration file:
**`/etc/NetworkManager/NetworkManager.conf`**

If the device is not managed by NetworkManager:

```
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
match-device=interface-name:*
```

To manage a device using NetworkManager (from the status bar next to the taskbar):

```
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true

[device]
match-device=interface-name:*
```

Don't forget to restart the NetworkManager service:

```
sudo systemctl restart NetworkManager
```

For a managed device (**managed = true**) additional menu items appear "**Disable**", "**ifupdown**" and the settings section becomes available **"Connection settings"**:

1. in the system tray, click on the Network Manager icon and select the name of the network card
2. bottom menu item ***"Connection settings..."*** is for changing settings (MTU, Wake-on-Lan, link negotiation, speed, proxy, IPv4 parameters - DHCP or manual, additional static addresses, DNS servers (for static IP address), additional DNS servers (for dynamic IP address), search domains, IPv6 parameters).

**Addition:** from 03/01/2025: you also need to “raise” the connection using the NetworkManager applet or command line utility `nmcli`

nmcli connection show
nmcli connection up "Проводное подключение 1"

**Update dated July 30, 2024**. After setting up netplan, you should rename the /etc/network/interfaces file, restart network services and check the IP address (it should change to the one specified in the connection settings in Network Manager or in the YAML configuration file /etc/netplan/\*.yaml).

```
sudo mv /etc/network/interfaces /etc/network/interfaces.old
sudo systemctl restart networking
systemctl status systemd-networkd
ip addr
```

### Conclusion

This article, like many others, contains examples of configuring netplan for both DHCP and simple static IP. The interfaces file is out of date. Use netplan. Netplan uses YAML for configuration. The /etc/network/interfaces file should be removed to avoid confusion.

---

**Sources:**
*[ubuntu-bionic-netplan](https://ubuntu.com/blog/ubuntu-bionic-netplan)* [man netplan](https://manpages.ubuntu.com/manpages/jammy/man5/netplan.5.html)
\*[netplan.io](https://netplan.io)

### Related publications

 [ ![](https://ra1ahq.blog/images/6/8/1/3/3/68133cc0ab7ddf32ba1a9c7eaeef3a6fa562e88f-msg.png) Tox Messenger ](https://ra1ahq.blog/en/tox-messenger) 

 [ ![](https://ra1ahq.blog/images/f/3/a/2/c/f3a2c07ef5b32c0308ab703405a5a5ca87b75283-archer-ac600-728.webp) Installing the kernel driver for the TP-Link Wi-Fi adapter after updating the Debian OS ](https://ra1ahq.blog/en/ustanovka-draivera-yadra-dlya-wi-fi-adaptera-tp-link-posle-obnovleniya-os-debian) 

 [ ![](https://ra1ahq.blog/images/d/2/5/c/7/d25c7282750b398f71041fb8b90640b692e7e4b8-decibelfmtitle.png) Linux Cinnamon Desktop Applets for Listening to Internet Radio Stations ](https://ra1ahq.blog/en/applety-dlya-rabochego-stola-linux-cinnamon-dlya-proslushivaniya-internet-radiostancii) 

 [ ![No picture](https://ra1ahq.blog/user/themes/mytheme/images/no-image.png) Passing a parameter to a Linux module/driver ](https://ra1ahq.blog/en/peredacha-parametra-modulyu-draiveru-linux) 

 [ ![](https://ra1ahq.blog/images/5/c/4/e/a/5c4ea9c8c3f0b4dd890116d8fe7cbadfdb9814ba-archer-ac600.webp) Installing the TP-Link Archer T600U Nano Wi-Fi adapter driver in Debian 13 "Trixie" ](https://ra1ahq.blog/en/ustanovka-draivera-wi-fi-adaptera-tp-link-archer-t600u-nano-v-debian-13-trixie) 

[ Backward](https://ra1ahq.blog/en/nastroika-keshiruyushego-dns-servera-systemd-resolved "Previuous page")

[ Forward ](https://ra1ahq.blog/en/rezhimy-persistence-i-frugal-v-mx-linux-i-antix "Next page")

## Languages

- [Русский](https://ra1ahq.blog/netplan-kak-zamena-etc-network-interfaces)
- [English](https://ra1ahq.blog/en/netplan-kak-zamena-etc-network-interfaces)
- [Deutsch](https://ra1ahq.blog/de/netplan-kak-zamena-etc-network-interfaces)
- [Français](https://ra1ahq.blog/fr/netplan-kak-zamena-etc-network-interfaces)
- [中文 (简体) (cn)](https://ra1ahq.blog/zh-cn/netplan-kak-zamena-etc-network-interfaces)

## Theme

## RSS feeds

 [ Atom 1.0](https://ra1ahq.blog/en/.atom) [ RSS](https://ra1ahq.blog/en/.rss) 

## Popular tags

 [APRS](https://ra1ahq.blog/en/tag:APRS) [CW](https://ra1ahq.blog/en/tag:CW) [DX](https://ra1ahq.blog/en/tag:DX) [FM](https://ra1ahq.blog/en/tag:FM) [Linux](https://ra1ahq.blog/en/tag:Linux) [VHF](https://ra1ahq.blog/en/tag:VHF) [antennas](https://ra1ahq.blog/en/tag:antennas) [firefox](https://ra1ahq.blog/en/tag:firefox) [morse](https://ra1ahq.blog/en/tag:morse) [soundtrack](https://ra1ahq.blog/en/tag:soundtrack) [video](https://ra1ahq.blog/en/tag:video) [windows](https://ra1ahq.blog/en/tag:windows) [youtube](https://ra1ahq.blog/en/tag:youtube) [КВ](https://ra1ahq.blog/en/tag:%D0%9A%D0%92) [ТВ](https://ra1ahq.blog/en/tag:%D0%A2%D0%92) [УКВ](https://ra1ahq.blog/en/tag:%D0%A3%D0%9A%D0%92) [антенны](https://ra1ahq.blog/en/tag:%D0%B0%D0%BD%D1%82%D0%B5%D0%BD%D0%BD%D1%8B) [безопасность](https://ra1ahq.blog/en/tag:%D0%B1%D0%B5%D0%B7%D0%BE%D0%BF%D0%B0%D1%81%D0%BD%D0%BE%D1%81%D1%82%D1%8C) [длинные волны](https://ra1ahq.blog/en/tag:%D0%B4%D0%BB%D0%B8%D0%BD%D0%BD%D1%8B%D0%B5%20%D0%B2%D0%BE%D0%BB%D0%BD%D1%8B) [путешествия](https://ra1ahq.blog/en/tag:%D0%BF%D1%83%D1%82%D0%B5%D1%88%D0%B5%D1%81%D1%82%D0%B2%D0%B8%D1%8F) [религия](https://ra1ahq.blog/en/tag:%D1%80%D0%B5%D0%BB%D0%B8%D0%B3%D0%B8%D1%8F) [соревнования](https://ra1ahq.blog/en/tag:%D1%81%D0%BE%D1%80%D0%B5%D0%B2%D0%BD%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F) [спутники](https://ra1ahq.blog/en/tag:%D1%81%D0%BF%D1%83%D1%82%D0%BD%D0%B8%D0%BA%D0%B8) [средние волны](https://ra1ahq.blog/en/tag:%D1%81%D1%80%D0%B5%D0%B4%D0%BD%D0%B8%D0%B5%20%D0%B2%D0%BE%D0%BB%D0%BD%D1%8B) [схемы](https://ra1ahq.blog/en/tag:%D1%81%D1%85%D0%B5%D0%BC%D1%8B) [тесты](https://ra1ahq.blog/en/tag:%D1%82%D0%B5%D1%81%D1%82%D1%8B) [трансивер](https://ra1ahq.blog/en/tag:%D1%82%D1%80%D0%B0%D0%BD%D1%81%D0%B8%D0%B2%D0%B5%D1%80) [управление](https://ra1ahq.blog/en/tag:%D1%83%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5) [фотографии](https://ra1ahq.blog/en/tag:%D1%84%D0%BE%D1%82%D0%BE%D0%B3%D1%80%D0%B0%D1%84%D0%B8%D0%B8) 

## Random post

 [ I'll be lucky!](https://ra1ahq.blog/en/random) 

## Archive of posts

- [ October 2026 ✒ 5 ](https://ra1ahq.blog/en/archives_month:oct_2026)
- [ September 2026 ✒ 9 ](https://ra1ahq.blog/en/archives_month:sep_2026)
- [ August 2026 ✒ 6 ](https://ra1ahq.blog/en/archives_month:aug_2026)
- [ July 2026 ✒ 13 ](https://ra1ahq.blog/en/archives_month:jul_2026)
- [ June 2026 ✒ 8 ](https://ra1ahq.blog/en/archives_month:jun_2026)
- [ May 2026 ✒ 2 ](https://ra1ahq.blog/en/archives_month:may_2026)
- [ April 2026 ✒ 6 ](https://ra1ahq.blog/en/archives_month:apr_2026)
- [ March 2026 ✒ 3 ](https://ra1ahq.blog/en/archives_month:mar_2026)
- [ February 2026 ✒ 7 ](https://ra1ahq.blog/en/archives_month:feb_2026)
- [ January 2026 ✒ 8 ](https://ra1ahq.blog/en/archives_month:jan_2026)
- [ December 2025 ✒ 12 ](https://ra1ahq.blog/en/archives_month:dec_2025)
- [ November 2025 ✒ 9 ](https://ra1ahq.blog/en/archives_month:nov_2025)
- [ October 2025 ✒ 8 ](https://ra1ahq.blog/en/archives_month:oct_2025)
- [ September 2025 ✒ 5 ](https://ra1ahq.blog/en/archives_month:sep_2025)
- [ August 2025 ✒ 8 ](https://ra1ahq.blog/en/archives_month:aug_2025)
- [ July 2025 ✒ 6 ](https://ra1ahq.blog/en/archives_month:jul_2025)
- [ June 2025 ✒ 10 ](https://ra1ahq.blog/en/archives_month:jun_2025)
- [ May 2025 ✒ 4 ](https://ra1ahq.blog/en/archives_month:may_2025)
- [ April 2025 ✒ 4 ](https://ra1ahq.blog/en/archives_month:apr_2025)
- [ March 2025 ✒ 4 ](https://ra1ahq.blog/en/archives_month:mar_2025)
- [ February 2025 ✒ 11 ](https://ra1ahq.blog/en/archives_month:feb_2025)
- [ December 2024 ✒ 8 ](https://ra1ahq.blog/en/archives_month:dec_2024)
- [ November 2024 ✒ 2 ](https://ra1ahq.blog/en/archives_month:nov_2024)
- [ October 2024 ✒ 8 ](https://ra1ahq.blog/en/archives_month:oct_2024)
- [ September 2024 ✒ 3 ](https://ra1ahq.blog/en/archives_month:sep_2024)
- [ August 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:aug_2024)
- [ July 2024 ✒ 9 ](https://ra1ahq.blog/en/archives_month:jul_2024)
- [ June 2024 ✒ 6 ](https://ra1ahq.blog/en/archives_month:jun_2024)
- [ May 2024 ✒ 7 ](https://ra1ahq.blog/en/archives_month:may_2024)
- [ April 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:apr_2024)
- [ March 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:mar_2024)
- [ February 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:feb_2024)
- [ January 2024 ✒ 6 ](https://ra1ahq.blog/en/archives_month:jan_2024)
- [ December 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:dec_2023)
- [ November 2023 ✒ 4 ](https://ra1ahq.blog/en/archives_month:nov_2023)
- [ October 2023 ✒ 8 ](https://ra1ahq.blog/en/archives_month:oct_2023)
- [ September 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:sep_2023)
- [ August 2023 ✒ 4 ](https://ra1ahq.blog/en/archives_month:aug_2023)
- [ July 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jul_2023)
- [ June 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jun_2023)
- [ May 2023 ✒ 5 ](https://ra1ahq.blog/en/archives_month:may_2023)
- [ April 2023 ✒ 6 ](https://ra1ahq.blog/en/archives_month:apr_2023)
- [ March 2023 ✒ 5 ](https://ra1ahq.blog/en/archives_month:mar_2023)
- [ February 2023 ✒ 2 ](https://ra1ahq.blog/en/archives_month:feb_2023)
- [ January 2023 ✒ 5 ](https://ra1ahq.blog/en/archives_month:jan_2023)
- [ December 2022 ✒ 7 ](https://ra1ahq.blog/en/archives_month:dec_2022)
- [ November 2022 ✒ 8 ](https://ra1ahq.blog/en/archives_month:nov_2022)
- [ October 2022 ✒ 6 ](https://ra1ahq.blog/en/archives_month:oct_2022)
- [ September 2022 ✒ 9 ](https://ra1ahq.blog/en/archives_month:sep_2022)
- [ August 2022 ✒ 8 ](https://ra1ahq.blog/en/archives_month:aug_2022)
- [ July 2022 ✒ 4 ](https://ra1ahq.blog/en/archives_month:jul_2022)
- [ June 2022 ✒ 9 ](https://ra1ahq.blog/en/archives_month:jun_2022)
- [ May 2022 ✒ 7 ](https://ra1ahq.blog/en/archives_month:may_2022)
- [ April 2022 ✒ 3 ](https://ra1ahq.blog/en/archives_month:apr_2022)
- [ March 2022 ✒ 4 ](https://ra1ahq.blog/en/archives_month:mar_2022)
- [ February 2022 ✒ 6 ](https://ra1ahq.blog/en/archives_month:feb_2022)
- [ January 2022 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jan_2022)
- [ December 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:dec_2021)
- [ November 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:nov_2021)
- [ October 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:oct_2021)
- [ September 2021 ✒ 10 ](https://ra1ahq.blog/en/archives_month:sep_2021)
- [ August 2021 ✒ 6 ](https://ra1ahq.blog/en/archives_month:aug_2021)
- [ July 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jul_2021)
- [ June 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jun_2021)
- [ May 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:may_2021)
- [ April 2021 ✒ 4 ](https://ra1ahq.blog/en/archives_month:apr_2021)
- [ March 2021 ✒ 4 ](https://ra1ahq.blog/en/archives_month:mar_2021)
- [ February 2021 ✒ 3 ](https://ra1ahq.blog/en/archives_month:feb_2021)
- [ January 2021 ✒ 4 ](https://ra1ahq.blog/en/archives_month:jan_2021)
- [ December 2020 ✒ 8 ](https://ra1ahq.blog/en/archives_month:dec_2020)
- [ November 2020 ✒ 2 ](https://ra1ahq.blog/en/archives_month:nov_2020)
- [ October 2020 ✒ 3 ](https://ra1ahq.blog/en/archives_month:oct_2020)
- [ September 2020 ✒ 3 ](https://ra1ahq.blog/en/archives_month:sep_2020)
- [ August 2020 ✒ 5 ](https://ra1ahq.blog/en/archives_month:aug_2020)
- [ July 2020 ✒ 5 ](https://ra1ahq.blog/en/archives_month:jul_2020)
- [ June 2020 ✒ 8 ](https://ra1ahq.blog/en/archives_month:jun_2020)
- [ May 2020 ✒ 10 ](https://ra1ahq.blog/en/archives_month:may_2020)
- [ April 2020 ✒ 4 ](https://ra1ahq.blog/en/archives_month:apr_2020)
- [ March 2020 ✒ 2 ](https://ra1ahq.blog/en/archives_month:mar_2020)
- [ January 2020 ✒ 1 ](https://ra1ahq.blog/en/archives_month:jan_2020)
- [ December 2019 ✒ 2 ](https://ra1ahq.blog/en/archives_month:dec_2019)

## Search

## Weather forecast

[На 14 дней](https://world-weather.ru/pogoda/russia/saint_petersburg/14days/)
[world-weather.ru](https://world-weather.ru/)

---

## Navigation

- Parent: [RA1AHQ](https://ra1ahq.blog/en/index.md)
- Previous: [Modes PErsistence и frugal в MX Linux и antix](https://ra1ahq.blog/en/rezhimy-persistence-i-frugal-v-mx-linux-i-antix.md)
- Next: [Configuring a systemd-resolved caching DNS server](https://ra1ahq.blog/en/nastroika-keshiruyushego-dns-servera-systemd-resolved.md)
