Netplan: Difference between revisions

From DWIKI
Tony (talk | contribs)
Tag: wikieditor
Tony (talk | contribs)
mNo edit summary
Tag: wikieditor
 
(8 intermediate revisions by the same user not shown)
Line 8: Line 8:
*[https://netplan.io/examples/ Netplan examples]
*[https://netplan.io/examples/ Netplan examples]
=HOWTO=
=HOWTO=
==Show netplan config==
netplan get all
==Verify netplan config==
netplan try
This will apply the setting but returns to old ones if you don't hit enter in time.
==Update netplan settings==
*[https://netplan.readthedocs.io/en/stable/netplan-set/ netplan-set]
==Update nameserver list==
netplan set "ethernets.eth0.nameservers.addresses=NULL"
and then
netplan set "ethernets.eth0.nameservers.addresses=[192.168.100.1, 192.168.100.19]"


= FAQ =
= FAQ =
== Cannot call Open vSwitch ==
apt install openvswitch-switch-dpdk


== An error occurred: 'NetplanApply' object has no attribute 'state ==
== An error occurred: 'NetplanApply' object has no attribute 'state ==
Line 37: Line 55:


==Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.==
==Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.==
  chmopd 0600 /etc/netplan/00-installer-config.yaml
  chmod 0600 /etc/netplan/00-installer-config.yaml
 
 
==Prevent cloudinit from updating netplan==
Create '''/etc/cloud/cloud.cfg.d/99-custom-networking.cfg''' and add:
network: {config: disabled}
 
 
[[Category:Ubuntu]]

Latest revision as of 07:36, 6 August 2025

Ubuntu network configuration new style


Links

HOWTO

Show netplan config

netplan get all

Verify netplan config

netplan try

This will apply the setting but returns to old ones if you don't hit enter in time.

Update netplan settings


Update nameserver list

netplan set "ethernets.eth0.nameservers.addresses=NULL"

and then

netplan set "ethernets.eth0.nameservers.addresses=[192.168.100.1, 192.168.100.19]"

FAQ

Cannot call Open vSwitch

apt install openvswitch-switch-dpdk

An error occurred: 'NetplanApply' object has no attribute 'state

That's because netplan is broken, try:

netplan try --state /etc/netplan


`gateway6` has been deprecated, use default routes instead

Use:

 routes:
   - to: default
     via: fe80::1


Error in network definition: expected mapping (check indentation)

It seems to prefer list of addresses in square brackets


`gateway4` has been deprecated, use default routes instead.

Try

routes:
  - to: default
    via: 192.168.10.1


Permissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.

chmod 0600 /etc/netplan/00-installer-config.yaml


Prevent cloudinit from updating netplan

Create /etc/cloud/cloud.cfg.d/99-custom-networking.cfg and add:

network: {config: disabled}