How to Use NetPlan in Ubuntu 18.04

preview_player
Показать описание
In this video, I go over how to use NetPlan the new NetworkManager for Ubuntu 18+.

New configuration files
/etc/netplan/ (Yaml Files)

Configuring:

network:
Version: 2
Renderer: networkd
ethernets:
DEVICE_NAME:
Dhcp4: yes/no
Addresses: [IP/NETMASK]
Gateway: GATEWAY
Nameservers:
Addresses: [NAMESERVER, NAMESERVER]

Where:
-DEVICE_NAME is the actual device name to be configured.
-yes/no is an option to enable or disable dhcp4.
-IP is the IP address for the device.
-NETMASK is the netmask for the IP address.
-GATEWAY is the address for your gateway.
-NAMESERVER is the comma-separated list of DNS nameservers.

Generate Configuration:
$ sudo netplan generate

Applying Configuration:
$ sudo netplan apply .

Рекомендации по теме
Комментарии
Автор

Great way to explain by showing mistakes in yaml formatting.
Anyway, what looks great about the actual netplan:
- single place to configure all the stuff
- validates the configuration before it is really applied (and tells you, where is the error)
- it builds on existing solutions (networkd or NetworkManager) making their use simple by providing unified configuration interface

I like it.

smibssmibs
Автор

netplan is a dream for automation because now you can just push a yaml file and provision a bunch of servers' networking. BAM done.

nnaaaaaa
Автор

I also really like netplan, the advanced stuff is also pretty simple to figure out as well.

digitalsparky
Автор

i configured netplan before in 18.04 for our server at my main job and i personally prefer it over the old method. personally i edit the yaml file with vim as i can set TAB to actually do 4 spaces instead :)

HikariKnight
Автор

5:50 Yay, I love playing "which of these invisible characters doesn't belong?" Netplan is fun for the whole family.

desromic
Автор

Nice explanation. I like how you demonstrated how netplan works by breaking it.

mrshodz
Автор

Super.W końcu ktoś konkretnie i na temat wytłumaczył co i jak i działa mi wszystko na Ubuntu 20.04.1 LTS

marmiz
Автор

OMG YES (I screamed when I saw the title and thumbnail for this video)

loukasmaki
Автор

Dude thank you so much. I was using the old networking commands and was stuck for about a good 2 hours before your video. I had to make some minor adjustments but your video without a doubt pointed me in the right direction and saved me so much time.

MMWA.F
Автор

This is the best example I have came across

zia.rehman
Автор

Hi, a tutorial with a Wifi interface would be great 😉

Speccyk
Автор

Thanks a lot! After struggling for hours with a malfunctioning network configuration (after cloning and migrating some VMs) Your video was quite an eye opener.
Bad luck for me, that most google-search-results point to solutions referring to /etc/network/interfaces.

antiantiantiantiantiantian
Автор

To make it the easy way, go to and make a copy of static.yaml to /etc/netplan then, put the right values in it, and you're good to go.

gaiusbaltar
Автор

Thanks for including those common errors towards the end.

dexterlowery
Автор

Yeah Yaml's got the same issue as Python, "tab" is a bad idea.
BTW, you can configure nano to auto convert tabs to spaces for you. Make a .nanorc file in your home folder and place the following lines into it:
set tabsize 4
set tabstospaces

Alternatively create an alias for nano to include the commandline parameters: nano -E -T 4

I'd actually go with the alias idea and give it some other name, so I can use nano in "yaml / python" mode, while for other stuff I can still use tabs if I want.

benriful
Автор

As a new guy to linux, i think that this is awesome

motsgar
Автор

I was just looking for how to do this and then you posted this! Than you!

josephroblesjr.
Автор

Thank you for your tutorial. I found it very helpful in troubleshooting some issues I was having.

reubenmartinez
Автор

If you forget the sudo, you can just use "sudo !!" it will fill in the last command.

miveliino
Автор

Great video, I love you showed the errors and then fixing them. More realistic when learning and new things.

jim