Netplan: Difference between revisions

From Omnia
Jump to navigation Jump to search
(Created page with "== examples == https://github.com/canonical/netplan/tree/main/examples == static == <pre> network: version: 2 renderer: networkd ethernets: enp3s0: address...")
 
No edit summary
Line 1: Line 1:
== config ==
/etc/netplan/01-netcfg.yaml
sudo netplan apply
sudo netplan --debug apply
== examples ==
== examples ==



Revision as of 19:31, 21 December 2023

config

/etc/netplan/01-netcfg.yaml
sudo netplan apply
sudo netplan --debug apply

examples

https://github.com/canonical/netplan/tree/main/examples

static

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      addresses:
        - 10.10.10.2/24
      nameservers:
        search: [mydomain, otherdomain]
        addresses: [10.10.10.1, 1.1.1.1]
      routes: 
        - to: default
          via: 10.10.10.1

ref: https://github.com/canonical/netplan/blob/main/examples/static.yaml

dhcp

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: true

ref: https://github.com/canonical/netplan/blob/main/examples/dhcp.yaml