Ubuntu Bionic: Netplan

Ubuntu Bionic: Netplan

The, Netplan, Can, With, Yaml, Configuration, Use, Configurations, Are, Files, That, Etc, Example, Test, Only, What, System, Balance, Static, Mode, Different, Setup

NetplanFor this weeks Bionic test blitz I am looking at Netplan! Netplan enables easily configuring networking on a syst


For this week’s Bionic test blitz I am looking at Netplan! Netplan enables easily configuring networking on a system via YAML files. Netplan processes the YAML and generates the required configurations for either NetworkManager or systemd-network the system’s renderer.

Netplan replaced ifupdown as the default configuration utility starting with Ubuntu 17.10 Artful.


Initial Setup in Bionic

When you install Bionic or use a cloud image of Bionic a file will appear in /etc/netplan depending on the renderer in use. Here is a breakdown of the various types:

Install Type
Server ISO
Cloud Image
Desktop ISO

Do note that configuration files can exist in three different locations with the precidence from most important to least as follows:

  • /run/netplan/*.yaml

  • /etc/netplan/*.yaml

  • /lib/netplan/*.yaml

Alphabetically later files, no matter what directory they are in, will amend keys if the key does not already exist and override previous keys if they do.


The best method for demonstrating what netplan can do is by showing some examples. Keep in mind that these are very simple examples that do not demonstrate complex situations that netplan can handle.

Static and DHCP Addressing

The following configures four devices:

  • enp3s0 setup with IPv4 DHCP

  • enp4s0 setup with IPv4 static with custom MTU

  • IPv6 static tied to a specific MAC address

  • IPv4 and IPv6 DHCP with jumbo frames tied to a specific MAC address

dhcp4: true
mtu: 1480
- fe80::a00:10a/120
gateway6: fe80::a00:101
macaddress: 52:54:00:12:34:06
dhcp4: true
dhcp6: true
macaddress: 52:54:00:12:34:07
mtu: 9000


Bonding can easily be configured with the required interfaces list and by specifying the mode. The mode can be any of the valid types: balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb. See the bonding wiki page for more details.

dhcp4: yes
- enp3s0
- enp4s0
mode: active-backup
primary: enp3s0


Here is a very simple example of a bridge using DHCP:

dhcp4: yes
- enp3s0

Additional parameters can be passed in to turn off STP for example or set priorities.


Similarly, vlans only require a name as the key and then an id and link to use for the vlan:

id: 101
link: net1
id: 102
link: net2
id: 103
link: net3
id: 104
link: net4

Issues Hit

While my configurations were not overly complex and only touched the surface of what netplan and networking can do I ran across a few issues and made a recommendation:

First, either the top level global routes are not supported (LP: #1720418) or the documentation is not correct (LP: #1726695). The README shows routes as a high-level key, but they are currently only supported at the interface level.

Second, there are numerous articles, examples, guides, and use-cases where an interfaces file is modified to include pre-up, pre-down, post-up, or post-down commands. Netplan does not currently have support for this (LP: #1664818). Here is a snip from the readme: “While the netplan configuration does not include support for hook scripts, you can add systemd unit jobs with the appropriate Requires: and After: fields to run arbitrary commands once the network is up.” I could only find one example of creating a systemd unit job to meet this need.

When attempting to use the ifupdown-migrate command I found it was unable to understand any static set interfaces (LP: #1709668).

Next, there is invalid YAML in docs (LP: #1735317). In YAML the colon ‘:’ is a reserved charachter and when the in-line array syntax can cause errors. For example:

# Correct, valid YAML
- 2001:1::1/64
# Invalid YAML
test: [2001:1::1/64]

If you must use the in-line array then put quotes around your strings containing special character like the colon. Also I suggest using a YAML syntax validator or linter to check your configuration files.

Finally, I requested a dry run or config test option (LP: #1735318). After trying to write numerous configurations to try different settings I got frustrated needing to move the configurations to a different system or in a container to test them without touching my local system.

Next Steps

I was left with an overall very positive impression of netplan. Having the ability to write YAML configuration files and not have to worry about how the actual configuration was generated or what commands need to be used depending on the backend simplifies the process. I would like to continue to attempt some more complex configurations that I can find as well as attempt additional test cases with the ifupdown-migrate subcommand.

Links & Refrences
  • Netplan Wiki

  • Netplan README

  • Netplan Source Code

  • Netplan Design Doc

  • Netplan Bugs

Zdroj: Ubuntu

2017-12-01 01:00:00 5325 1429Facebook | Twitter | Google+ | LinkedIn
Web PHP developer Milan Jankovec

<Milan Jankovec> Full Stack Web Developer

Vytváram webové stránky a aplikácie na mieru. Čistý a validný HTML5 kód na každej platforme, moderné animované CSS3 štýly a neuveriteľné JavaScript kúzla. Bezpečný a rýchly PHP kód bez obmedzení s geniálnou architektúrou databáz.

Najčítanejšie články

What's New in MySQL 5.6 Release Candidate

The MySQL 5.6 Release Candidate is an aggregation of the previous MySQL 5.6 Development Milestone Releases (DMR) and provides a true functio... čítať viac

MySQL 5.6: Improvements in Thread Pool

MySQL Thread Pool has now been updated for the MySQL 5.6 version. Obviously, with the much higher concurrency of the MySQL Server in 5.6 its... čítať viac

DBA and Developer Guide to MySQL 5.6

MySQL is the most trusted and depended-on open source database platform in use today. As such, 9 out of the top 10 most popular and highly-t... čítať viac

MySQL Applier for Hadoop

To support the growing emphasis on real-time operations, MySQL is releasing a new MySQL Applier for Hadoop to enable the replication of even... čítať viac

MySQL Cluster 7.3 GA: Increasing Developer Flexibility and Simplicity

The MySQL team at Oracle are excited to announce the immediate availability of the MySQL Cluster 7.3 Development Milestone Release GA releas... čítať viac

MySQL Cluster Auto-Installer: Video Tutorial

Learn how easy it is to deploy a MySQL Cluster database that has been configured to best meet your applications needs within your environmen... čítať viac

MySQL Replication Utilities: Video Tutorial

Learn how to use MySQL 5.6 and the MySQL Utilities to setup, monitor and manage your MySQL replication topology. See how a single command ca... čítať viac

MySQL 5.6 Replication - Enabling the Next Generation of Web & Cloud Services

The new MySQL 5.6.5 Development Milestone Release (DMR) introduces a much anticipated feature - Global Transaction Identifiers (GTIDs) for M... čítať viac

Dnešný výber

Apache Archiva 2.1.0

Hi, The Apache Archiva team would like to announce the release of Archiva 2.1.0. Archiva is available for download from the web site ( http:... čítať viac

Ubuntu - Self-containing dependencies LogMeIn to publish their first Snap

LogMeIn is one of the worlds top 10 public SaaS companies, and a market leader in communication & conferencing, identity... čítať viac

Apache Beam 2.7.0 released!

The Apache Beam team is pleased to announce the release of version 2.7.0!Apache Beam is an open source unified programmi... čítať viac

Scorpion Logout Button (Joomla)

Je dostupné nové rozšírenie pre redakčný systém Joomla pod názvom Scorpion Logout Button (Joomla). This modules gives you the opportunity to... čítať viac

CountdownAholic (Joomla)

Je dostupné nové rozšírenie pre redakčný systém Joomla pod názvom CountdownAholic (Joomla). CountdownAholic is a option rich countdown modul... čítať viac

First Public Working Draft: CSS Inline Layout; CSS Box Alignment Draft Published

The Cascading Style Sheets (CSS) Working Group has published two documents today: A First Public Working Draft of CSS Inline Layout Module L... čítať viac

3d slider (Joomla)

Je dostupné nové rozšírenie pre redakčný systém Joomla pod názvom 3d slider (Joomla). 3D Slider Slideshow For Joomla 2.5 - 3.x. Module let y... čítať viac

High Resolution Time Level 2 Draft Published

The Web Performance Working Group has published a Working Draft of High Resolution Time Level 2. This specification defi... čítať viac