The network configuration abstraction renderer
Netplan is a utility for easily configuring networking on a
Currently supported backends are
A little History
Netplan was introduced to the mainstream in Ubuntu 18.04 as the new default way to configure network interfaces. For those familiar with the old /etc/network/interfaces file, Netplan was unwanted and seen as a complicated way to do a simple thing.
I, personally, felt this way as well as a bunch of other people in various forums across the net. That was until I learned how to use it and seen how powerful it is. Now, I welcome Netplan and hope that all Linux flavors add support for it!
How Netplan makes migrations and Disaster Recovery easier
When you migrate a Linux machine to a new hypervisor you have two main issues that you face.
- driver requirements for new hardware
- configuration for new network adapters
The first issue, hardware drivers, are easily handled by modifying Linux
I didn’t talk too much about reliable networking configuration, because in some cases things “just worked.” In the case of CentOS
Netplan for VMware
So a Netplan YAML file for VMware with a static IP address that will be assigned to a nic that has a particular MAC address would look something like this:
As you can see its pretty straight forward. We define a network adapter (ens160), of type ethernet, which needs to match a MAC address. When it finds that nic, assign it an address along with gateway, nameservers, and a search domain.
Netplan for public cloud
Let me start by showing you the YAML files for both AWS and Azure.
These are even simpler than the config for VMware. They search for a nic that uses a particular Linux kernel driver, then configures that nic for dhcp and renames the nic to something easy to use.
These are all very basic config’s for instances with a single network adapter, and more complex
Recap of what Netplan does
When your machine boots up with the above YAML config files in the /etc/netplan folder, Netplan will generate a configuration for the normal Linux network manager you are using (either systemd-networkd or NetworkManager) so that that manager knows what to do with your network cards.
It does this EVERY time the machine boots. which means that if it “wakes up” in Azure or AWS… it will find that new network card and assign it the proper configuration.
But Netplan is an Ubuntu project, I use RHEL…
I thought you might say that … not to fear, Netplan is open source, you can compile it on any flavor of Linux you want as long as you meet the dependencies.
There is also a yum repository that has epel releases that can be applied to both CentOS and RHEL here https://copr.fedorainfracloud.org/coprs/ngompa/Netplan/
What I’ve tested so far
So far I have tested Netplan on Ubuntu 18.04 to both Azure and AWS from VMware.
I have also tested Centos7 and RHEL7 from to Azure and AWS from VMware.
What I still need to do
Still to do is test older versions of each OS, including CentOS6, RHEL6, Ubuntu 16.04. I will test both Azure and AWS as recovery targets.
I also need to see what it will take to get Netplan compiled with Python 3.6 support, because right now the epel repo only has Python 3.4 support.
I would also like to get involved more with Netplan and see what I can do for the project