### Clone and Install Dependencies Source: https://github.com/canonical/netplan/blob/main/tests/config_fuzzer/README.md Initial setup steps to prepare the fuzzer environment. ```bash git clone https://github.com/canonical/netplan.git cd netplan/tests/config_fuzzer npm install ``` -------------------------------- ### Netplan info output example Source: https://github.com/canonical/netplan/blob/main/README.md Example output from running 'netplan info'. ```yaml # output: netplan.io: website: "https://netplan.io/" features: - dhcp-use-domains - auth-phase2 ... ``` -------------------------------- ### Install Make Utility Source: https://github.com/canonical/netplan/blob/main/doc/contribute-docs.md Install the 'make' utility on your system if it is not already present. This is required for building the documentation. This command is compatible with Unix-like systems. ```bash sudo apt-get install make ``` -------------------------------- ### Install LXD Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Installs the LXD container and virtual machine manager using snap. ```default snap install lxd ``` -------------------------------- ### Create and Configure VM Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Commands to initialize, attach network interfaces, start, and access a virtual machine. ```none lxc init --vm ubuntu:23.10 netplan-lab0 ``` ```default Creating netplan-lab0 ``` ```default lxc network attach netplanbr0 netplan-lab0 eth1 ``` ```default lxc start netplan-lab0 ``` ```default lxc shell netplan-lab0 ``` ```none root@netplan-lab0:~# ``` -------------------------------- ### Install build dependencies Source: https://github.com/canonical/netplan/blob/main/README.md List of commands to install required build and test dependencies on Ubuntu/Debian. ```bash sudo apt install \ build-essential \ pkg-config \ meson \ libglib2.0-dev \ libyaml-dev \ libsystemd-dev \ uuid-dev \ bash-completion \ python3-dev \ python3-cffi \ python3-coverage \ python3-pytest \ python3-pytest-cov \ pyflakes3 \ pycodestyle \ libcmocka-dev \ gcovr \ pandoc ``` -------------------------------- ### Example Interface Output Source: https://github.com/canonical/netplan/blob/main/doc/matching-interface-by-mac-address.md Sample output showing the link/ether property containing the MAC address. ```text 3: enp6s0: mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 00:16:3e:0c:97:8a brd ff:ff:ff:ff:ff:ff ``` -------------------------------- ### Test local build with 'netplan info' Source: https://github.com/canonical/netplan/blob/main/README.md Example of using 'make run' to execute 'netplan info' and display its output. ```bash $ make run ARGS="info" ``` -------------------------------- ### Example Bond Interface Status Output Source: https://github.com/canonical/netplan/blob/main/doc/creating-link-aggregation.md This is an example of the output you should expect when checking the status of a configured bond interface. ```text Online state: online DNS Addresses: 127.0.0.53 (stub) DNS Search: lxd netplanlab.local ● 4: isp-bond0 bond UP (networkd: isp-bond0) MAC Address: b2:6b:19:b1:9a:86 Addresses: 172.16.0.1/24 DNS Addresses: 172.16.0.254 172.16.0.253 DNS Search: netplanlab.local Routes: default via 172.16.0.254 (static) 172.16.0.0/24 from 172.16.0.1 (link) 3 inactive interfaces hidden. Use "--all" to show all. ``` -------------------------------- ### Run netplan CLI with arguments Source: https://github.com/canonical/netplan/blob/main/README.md Example of running the locally built netplan CLI with arguments using 'make run'. ```bash $ make run ARGS="help" ``` -------------------------------- ### Configure IP Addresses Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Examples for defining simple and advanced IP address configurations with lifetime and label parameters. ```yaml addresses: [192.168.14.2/24, "2001:1::1/64"] ``` ```yaml network: ethernets: eth0: addresses: - "10.0.0.15/24": lifetime: 0 label: "maas" - "2001:1::1/64" ``` -------------------------------- ### Check Netplan Configuration Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Use `netplan get` to display the current Netplan configuration, verifying applied changes. ```bash netplan get ``` ```yaml network: version: 2 ethernets: enp5s0: dhcp4: true enp6s0: dhcp4: true accept-ra: false link-local: [] ``` -------------------------------- ### Install NetworkManager Source: https://github.com/canonical/netplan/blob/main/doc/netplan-everywhere.md Install the NetworkManager package, which includes Netplan integration. This command updates the package list and then installs the specified package. ```bash $ sudo apt update $ sudo apt install network-manager ``` -------------------------------- ### Enable virtual networks with virsh Source: https://github.com/canonical/netplan/blob/main/doc/reuse/configure-vm-create-bridged-networks.md Commands to define, start, and set autostart for the configured bridge networks. ```bash virsh net-define net-br0.xml virsh net-define net-br0-vlan40.xml virsh net-define net-br0-vlan41.xml virsh net-start br0 virsh net-start br0-vlan40 virsh net-start br0-vlan41 virsh net-autostart br0 virsh net-autostart br0-vlan40 virsh net-autostart br0-vlan41 ``` -------------------------------- ### Configure Wi-Fi Access Points with Netplan Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Use the `wifis` key to configure Wi-Fi access points. This example shows the general structure for Wi-Fi configuration, including specifying an SSID and password. ```yaml network: version: 2 wifis: wlp0s1: access-points: "network_ssid_name": password: "**********" ``` -------------------------------- ### GET /netplan/get Source: https://github.com/canonical/netplan/blob/main/doc/netplan-get.md Retrieves the merged Netplan configuration from the system. ```APIDOC ## GET netplan get ### Description Reads all YAML files from /{etc,lib,run}/netplan/*.yaml and returns a merged view of the current configuration. ### Method GET ### Endpoint netplan get [key] ### Parameters #### Query Parameters - **key** (string) - Optional - The configuration key to retrieve (e.g., [network.]ethernets.eth0). Defaults to 'all'. - **--root-dir** (string) - Optional - Read YAML files from this root directory instead of '/'. - **--debug** (flag) - Optional - Print debugging output during the process. ### Request Example netplan get network.ethernets.eth0 ### Response #### Success Response (200) - **output** (string) - The merged YAML configuration subtree or full tree. ``` -------------------------------- ### Configure WireGuard with a shared key file Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example of a WireGuard tunnel using a path to a shared key file. ```yaml network: tunnels: wg0: mode: wireguard addresses: [...] peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= shared: /path/to/shared.key ... key: mNb7OIIXTdgW4khM7OFlzJ+UPs7lmcWHV7xjPgakMkQ= ``` -------------------------------- ### Manage Libvirt Bridged Network Source: https://github.com/canonical/netplan/blob/main/doc/single-nic-vm-host.md Commands to define, start, and enable autostart for a libvirt network. This sequence ensures the 'br0' bridged network is active and persistent across reboots. ```shell virsh net-define net-br0.xml virsh net-start br0 virsh net-autostart br0 ``` -------------------------------- ### Bond Interface Assignment via Match Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example of assigning interfaces to a bond using a match pattern for device names. ```yaml network: ethernets: switchports: match: {name: "enp2*"} [...] bonds: bond0: interfaces: [switchports] ``` -------------------------------- ### Configure WireGuard with a private key file Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example of a WireGuard tunnel using a path to a private key file via the keys mapping. ```yaml network: tunnels: wg0: mode: wireguard addresses: [...] peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= ... keys: private: /path/to/priv.key ``` -------------------------------- ### Configure Multiple Bonds Source: https://github.com/canonical/netplan/blob/main/doc/examples.md Example of configuring multiple bonded interfaces for different network roles (LAN, WAN, conntrack). 'optional: true' allows booting without waiting for interface activation. ```yaml network: version: 2 renderer: networkd ethernets: enp1s0: dhcp4: no enp2s0: dhcp4: no enp3s0: dhcp4: no optional: true enp4s0: dhcp4: no optional: true enp5s0: dhcp4: no optional: true enp6s0: dhcp4: no optional: true bonds: bond-lan: interfaces: [enp2s0, enp3s0] addresses: [192.168.93.2/24] parameters: mode: 802.3ad mii-monitor-interval: 1 bond-wan: interfaces: [enp1s0, enp4s0] addresses: [192.168.1.252/24] nameservers: search: [local] addresses: [8.8.8.8, 8.8.4.4] parameters: mode: active-backup mii-monitor-interval: 1 gratuitous-arp: 5 routes: - to: default via: 169.254.1.1 bond-conntrack: interfaces: [enp5s0, enp6s0] addresses: [192.168.254.2/24] parameters: mode: balance-rr mii-monitor-interval: 1 ``` -------------------------------- ### Configure tunnel keys as a mapping Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example showing how to specify separate input and output keys for a GRE tunnel. ```yaml network: tunnels: tun0: mode: gre local: ... remote: ... keys: input: 1234 output: 5678 ``` -------------------------------- ### Configure Modem Interface with Netplan Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Use this configuration to set up a modem interface. Ensure the renderer is set to NetworkManager. This example shows common modem properties such as APN, username, password, and device identifiers. ```yaml network: version: 2 renderer: NetworkManager modems: cdc-wdm1: mtu: 1600 apn: ISP.CINGULAR username: ISP@CINGULARGPRS.COM password: CINGULAR1 number: "*99#" network-id: 24005 device-id: da812de91eec16620b06cd0ca5cbc7ea25245222 pin: 2345 sim-id: 89148000000060671234 sim-operator-id: 310260 ``` -------------------------------- ### Configure a WireGuard tunnel with NetworkManager Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example of a WireGuard tunnel configuration using the NetworkManager renderer with private key flags. ```yaml network: renderer: NetworkManager tunnels: wg0: mode: wireguard port: 5182 key: private-key-flags: - agent-owned peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= allowed-ips: [0.0.0.0/0, "2001:fe:ad:de:ad:be:ef:1/24"] keepalive: 23 endpoint: 1.2.3.4:5 ``` -------------------------------- ### Basic Bond Configuration Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example structure for defining a bond interface with multiple member interfaces and a specific bonding mode. ```yaml network: bonds: bond0: interfaces: - enp5s0 - enp5s1 - enp5s2 parameters: mode: active-backup ... ``` -------------------------------- ### Configure Static IP, Route, and DNS in Netplan Source: https://github.com/canonical/netplan/blob/main/doc/using-static-ip-addresses.md Use this YAML configuration to set a static IP address, default route, and DNS servers for a network interface. Ensure the interface name and IP addresses match your network setup. ```yaml network: version: 2 ethernets: enp6s0: dhcp4: false dhcp6: false accept-ra: false link-local: [] addresses: - 172.16.0.1/24 routes: - to: default via: 172.16.0.254 nameservers: search: - netplanlab.local addresses: - 172.16.0.254 - 172.16.0.253 ``` -------------------------------- ### Configure nm-devices with NetworkManager Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Use the `nm-devices` key to configure device types not directly supported by Netplan, utilizing NetworkManager's specific settings. This example shows a VPN connection configuration. ```yaml network: version: 2 nm-devices: NM-db5f0f67-1f4c-4d59-8ab8-3d278389cf87: renderer: NetworkManager networkmanager: uuid: "db5f0f67-1f4c-4d59-8ab8-3d278389cf87" name: "myvpnconnection" passthrough: connection.type: "vpn" vpn.ca: "path to ca.crt" vpn.cert: "path to client.crt" vpn.cipher: "AES-256-GCM" vpn.connection-type: "tls" vpn.dev: "tun" vpn.key: "path to client.key" vpn.remote: "1.2.3.4:1194" vpn.service-type: "org.freedesktop.NetworkManager.openvpn" ``` -------------------------------- ### Observe NetworkManager Migration Logs Source: https://github.com/canonical/netplan/blob/main/doc/netplan-everywhere.md During the installation or upgrade of the network-manager package, observe the logs to see connection profiles being migrated to Netplan YAML files. This indicates the integration process is active. ```text Setting up network-manager (1.44.2-1ubuntu1.2) ... Migrating HomeNet (9d087126-ae71-4992-9e0a-18c5ea92a4ed) to /etc/netplan Migrating eduroam (37d643bb-d81d-4186-9402-7b47632c59b1) to /etc/netplan Migrating DebConf (f862be9c-fb06-4c0f-862f-c8e210ca4941) to /etc/netplan ``` -------------------------------- ### WireGuard Tunnel Example Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example configuration for a WireGuard tunnel interface. ```APIDOC ## WireGuard Tunnel Configuration Example ### Description This example demonstrates the configuration of a WireGuard tunnel interface, including peer settings and key management. ### Method N/A (Configuration file structure) ### Endpoint N/A (Configuration file structure) ### Parameters See general Tunnel Interface Configuration for common parameters. #### WireGuard Specific Parameters: - **`port`** (scalar) - Optional - The UDP port for WireGuard. - **`peers`** (sequence of mappings) - Optional - A list of WireGuard peers. - **`keys`** (mapping) - Required for peers - Public key and optional shared key or path. - **`public`** (scalar) - Required - The peer's public key. - **`shared`** (scalar) - Optional - Path to a shared secret key file. - **`allowed-ips`** (sequence of scalars) - Optional - IP addresses allowed from this peer. - **`endpoint`** (scalar) - Optional - The endpoint address and port for the peer. - **`keepalive`** (scalar) - Optional - Keepalive interval in seconds. ### Request Example ```yaml network: renderer: NetworkManager tunnels: wg0: mode: wireguard port: 5182 addresses: ["10.0.0.1/24"] peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= allowed-ips: ["0.0.0.0/0", "2001:fe:ad:de:ad:be:ef:1/24"] keepalive: 23 endpoint: 1.2.3.4:5 key: private-key-flags: - agent-owned ``` ### Response N/A (Configuration file structure) ### Success Response (200) N/A (Configuration file structure) ### Response Example N/A (Configuration file structure) ``` -------------------------------- ### Run documentation locally Source: https://github.com/canonical/netplan/blob/main/README.md Command to view documentation in the browser by running 'make' from the 'doc/' directory. ```bash make run ``` -------------------------------- ### Navigate to Documentation Directory Source: https://github.com/canonical/netplan/blob/main/doc/contribute-docs.md Change the current directory to the 'doc/' directory within the cloned Netplan repository to access documentation-specific commands. ```bash cd netplan/doc ``` -------------------------------- ### Create VM data directory Source: https://github.com/canonical/netplan/blob/main/doc/reuse/configure-vm-create-bridged-networks.md Prepare the filesystem directory for storing virtual machine network configuration files. ```bash mkdir /mnt/vmstore/ cd /mnt/vmstore/ ``` -------------------------------- ### Navigate to the documentation directory Source: https://github.com/canonical/netplan/blob/main/README.md Command to change the current directory to the 'doc/' folder. ```bash cd doc ``` -------------------------------- ### Initialize LXD Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Performs a minimal initialization of the LXD configuration. ```default lxd init --minimal ``` -------------------------------- ### Configure a VTI6 tunnel with a scalar key Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example of a VTI6 tunnel using a single scalar value for the key. ```yaml network: tunnels: tun0: mode: vti6 local: ... remote: ... key: 59568549 ``` -------------------------------- ### Build using Makefile Source: https://github.com/canonical/netplan/blob/main/README.md Convenience targets for building and testing Netplan using make. ```bash make ``` ```bash make check ``` ```bash make linting ``` ```bash make install [DESTDIR=../tmproot] ``` ```bash make clean ``` ```bash make run ARGS='' ``` -------------------------------- ### Verify configuration file creation Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Lists files in the configuration directory to confirm the new file exists. ```none ls -1 /etc/netplan ``` -------------------------------- ### Build using Meson Source: https://github.com/canonical/netplan/blob/main/README.md Commands for building Netplan using the Meson build system. ```bash meson setup build --prefix=/usr [-Db_coverage=true] ``` ```bash meson compile -C build ``` ```bash meson test -C build --verbose [TEST_NAME] ``` ```bash meson install -C build --destdir ../tmproot ``` -------------------------------- ### Configure SR-IOV Virtual Function link Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example of linking a Virtual Function to a Physical Function using the link property. ```yaml network: ethernets: enp1: {...} enp1s16f1: link: enp1 ``` -------------------------------- ### Invoke Netplan CLI Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Displays the help menu and available sub-commands for the Netplan utility. ```default netplan ``` ```none You need to specify a command usage: /usr/sbin/netplan [-h] [--debug] ... Network configuration in YAML options: -h, --help show this help message and exit --debug Enable debug messages Available commands: help Show this help message apply Apply current Netplan config to running system generate Generate back end specific configuration files from /etc/netplan/*.yaml get Get a setting by specifying a nested key like "ethernets.eth0.addresses", or "all" info Show available features ip Retrieve IP information from the system set Add new setting by specifying a dotted key=value pair like ethernets.eth0.dhcp4=true rebind Rebind SR-IOV virtual functions of given physical functions to their driver status Query networking state of the running system try Try to apply a new Netplan config to running system, with automatic rollback ``` -------------------------------- ### View All Network Configuration with Netplan Source: https://github.com/canonical/netplan/blob/main/doc/using-static-ip-addresses.md Run this command to display the current network configuration as parsed by Netplan. The output may differ in order from the YAML file but represents an equivalent configuration. ```bash netplan get ``` -------------------------------- ### Configure Bond Interface in Netplan Source: https://github.com/canonical/netplan/blob/main/doc/creating-link-aggregation.md Define an ethernet interface and then configure a bond interface that uses it. This setup is for link aggregation. ```yaml network: version: 2 ethernets: netplan-isp-interface: dhcp4: false dhcp6: false match: macaddress: 00:16:3e:0c:97:8a set-name: netplan-isp bonds: isp-bond0: interfaces: - netplan-isp-interface dhcp4: false dhcp6: false accept-ra: false link-local: [] addresses: - 172.16.0.1/24 routes: - to: default via: 172.16.0.254 nameservers: search: - netplanlab.local addresses: - 172.16.0.254 - 172.16.0.253 ``` -------------------------------- ### Configure Dummy Device with IP Address Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Use the `dummy-devices` key to define virtual interfaces. Specify the interface name (e.g., `dm0`) and its network addresses. This configuration creates a virtual interface that can be used for routing. ```yaml network: dummy-devices: dm0: addresses: - 192.168.0.123/24 ... ``` -------------------------------- ### List Netplan configuration files Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Displays the contents of the /etc/netplan directory to identify configuration files. ```none ls -1 /etc/netplan/ ``` -------------------------------- ### Test Netplan Configuration Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Use `netplan try` to temporarily apply new configuration for a limited time, allowing for confirmation before making it permanent. ```bash netplan try ``` -------------------------------- ### Configure WireGuard Tunnel Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Example configuration for a WireGuard tunnel interface including multiple peers with public keys, allowed IPs, and keepalive settings. ```yaml network: tunnels: wg0: mode: wireguard key: /path/to/private.key mark: 42 port: 5182 peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= allowed-ips: [0.0.0.0/0, "2001:fe:ad:de:ad:be:ef:1/24"] keepalive: 23 endpoint: 1.2.3.4:5 - keys: public: M9nt4YujIOmNrRmpIRTmYSfMdrpvE7u6WkG8FY8WjG4= shared: /some/shared.key allowed-ips: [10.10.10.20/24] keepalive: 22 endpoint: 5.4.3.2:1 ``` -------------------------------- ### Match interface by name glob Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Use this to match all network interfaces whose names start with 'enp2'. This is useful for applying configurations to a group of similar interfaces. ```yaml network: ethernets: myinterface: match: name: enp2* ``` -------------------------------- ### Check Documentation Spelling Source: https://github.com/canonical/netplan/blob/main/doc/contribute-docs.md Run the 'make spelling' command to check for spelling errors in the documentation's HTML files. Ensure 'aspell' is installed for this command to function correctly. ```bash make spelling ``` -------------------------------- ### Test and apply Netplan configuration Source: https://github.com/canonical/netplan/blob/main/doc/multi-nic-vm-host-with-bonds-and-vlans.md Commands to validate and apply the new network configuration. ```none netplan try ``` ```default netplan apply ``` -------------------------------- ### Configure network interface with netplan set Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Creates or modifies configuration files using the netplan set command with an origin hint. ```default netplan set --origin-hint second-interface ethernets.enp6s0.dhcp4=true ``` -------------------------------- ### Create a new configuration object and get merged YAML Source: https://github.com/canonical/netplan/blob/main/doc/dbus-config.md This sequence of commands creates a new configuration object and then retrieves its merged YAML configuration. ```console busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/KC0IU0 busctl call io.netplan.Netplan /io/netplan/Netplan/config/KC0IU0 \ io.netplan.Netplan.Config Get s "network:\n ethernets:\n eth0:\n dhcp4: false\n dhcp6: true\n renderer: networkd\n version: 2\n" ``` -------------------------------- ### Test Netplan Against Generated YAML Source: https://github.com/canonical/netplan/blob/main/tests/config_fuzzer/README.md Manual steps to verify generated YAML files using the netplan generate command. ```bash mkdir -p fakeroot/etc/netplan cp fakedata/someyaml.yaml fakeroot/etc/netplan/ netplan generate --root-dir fakeroot ``` -------------------------------- ### Clone the Netplan repository Source: https://github.com/canonical/netplan/blob/main/README.md Steps to fork and clone the Netplan repository for documentation contributions. ```bash git clone git@github.com:your_user_name/netplan.git ``` -------------------------------- ### Match interface by driver and name glob Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md Apply configuration to the first network interface matching both a specific driver ('ixgbe') and a name pattern ('en*s0'). ```yaml network: ethernets: nic0: match: driver: ixgbe name: en*s0 ``` -------------------------------- ### Apply Netplan Configuration Source: https://github.com/canonical/netplan/blob/main/doc/creating-link-aggregation.md Use the `netplan apply` command to apply the network configuration changes. ```bash netplan apply ``` -------------------------------- ### Check Documentation Links Source: https://github.com/canonical/netplan/blob/main/doc/contribute-docs.md Execute the 'make linkcheck' command to verify that all links within the documentation are valid and not broken. ```bash make linkcheck ``` -------------------------------- ### Open vSwitch Configuration Options Source: https://github.com/canonical/netplan/blob/main/doc/netplan-yaml.md This section outlines the various configuration options available for Open vSwitch within Netplan, including parameters for bridges, bonds, and general settings. ```APIDOC ## Open vSwitch Configuration ### Description Configuration options for Open vSwitch integration with Netplan. ### Parameters #### `external-ids` (mapping) - since 0.100 Passed-through directly to Open vSwitch. #### `other-config` (mapping) - since 0.100 Passed-through directly to Open vSwitch. #### `lacp` (scalar) - since 0.100 Valid for bond interfaces. Accepts `active`, `passive` or `off` (the default). #### `fail-mode` (scalar) - since 0.100 Valid for bridge interfaces. Accepts `secure` or `standalone` (the default). #### `mcast-snooping` (boolean) - since 0.100 Valid for bridge interfaces. False by default. #### `protocols` (sequence of scalars) - since 0.100 Valid for bridge interfaces or the network section. List of protocols to be used when negotiating a connection with the controller. Accepts `OpenFlow10`, `OpenFlow11`, `OpenFlow12`, `OpenFlow13`, `OpenFlow14`, and `OpenFlow15`. #### `rstp` (boolean) - since 0.100 Valid for bridge interfaces. False by default. #### `controller` (mapping) - since 0.100 Valid for bridge interfaces. Specify an external OpenFlow controller. ##### `addresses` (sequence of scalars) Set the list of addresses to use for the controller targets. The syntax of these addresses is as defined in `ovs-vsctl`(8). Example: `addresses: [tcp:127.0.0.1:6653, "ssl:[fe80::1234%eth0]:6653"]`. ##### `connection-mode` (scalar) Set the connection mode for the controller. Supported options are `in-band` and `out-of-band`. The default is `in-band`. #### `ports` (sequence of sequence of scalars) - since 0.100 Open vSwitch patch ports. Each port is declared as a pair of names which can be referenced as interfaces in dependent virtual devices (bonds, bridges). Example: ```yaml openvswitch: ports: - [patch0-1, patch1-0] ``` #### `ssl` (mapping) - since 0.100 Valid for global `openvswitch` settings. Options for configuring SSL server endpoint for the switch. ##### `ca-cert` (scalar) Path to a file containing the CA certificate to be used. ##### `certificate` (scalar) Path to a file containing the server certificate. ##### `private-key` (scalar) Path to a file containing the private key for the server. ``` -------------------------------- ### Display generated configuration file content Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Reads the content of the newly created configuration file. ```default cat /etc/netplan/second-interface.yaml ``` -------------------------------- ### Retrieve Netplan Configuration Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Fetches and displays the current system network configuration in YAML format. ```default netplan get ``` ```yaml network: version: 2 ethernets: enp5s0: dhcp4: true ``` -------------------------------- ### Write a new configuration snippet Source: https://github.com/canonical/netplan/blob/main/doc/dbus-config.md This command writes a new configuration snippet into a specified YAML file (e.g., 70-snapd.yaml) for a given configuration object. ```console busctl call io.netplan.Netplan /io/netplan/Netplan/config/ULJIU0 \ io.netplan.Netplan.Config Set ss "ethernets.eth0={dhcp4: false, dhcp6: true}" "70-snapd" b true ``` -------------------------------- ### Copy the current state from configuration files Source: https://github.com/canonical/netplan/blob/main/doc/dbus-config.md This command creates a new configuration object by copying the current state from Netplan YAML files. ```console busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/ULJIU0" ``` -------------------------------- ### Create a new branch for contributions Source: https://github.com/canonical/netplan/blob/main/README.md Command to create a new branch for making documentation changes. ```bash git checkout -b ``` -------------------------------- ### Netplan Match Configuration Snippet Source: https://github.com/canonical/netplan/blob/main/doc/matching-interface-by-mac-address.md A focused view of the match and set-name configuration block. ```yaml ethernets: netplan-isp-interface: match: macaddress: 00:16:3e:0c:97:8a set-name: netplan-isp ``` -------------------------------- ### Read Netplan configuration file content Source: https://github.com/canonical/netplan/blob/main/doc/netplan-tutorial.md Displays the YAML configuration content of a specific Netplan file. ```none cat /etc/netplan/50-cloud-init.yaml ``` -------------------------------- ### List virtual networks Source: https://github.com/canonical/netplan/blob/main/doc/reuse/configure-vm-check-networking-delete-default.md Displays all defined virtual networks to verify their current state. ```bash virsh net-list --all ``` -------------------------------- ### Compare Library ABI with abidiff Source: https://github.com/canonical/netplan/blob/main/abi-compat/README.md Use the `abidiff` tool to compare a new library ABI against an existing XML reference. This helps identify breaking changes. Consider using suppression files for known, acceptable changes. ```bash abidiff abi-compat/noble_1.1.xml _build/src/libnetplan.so.1 --headers-dir2 include/ --header-file2 src/abi.h --suppressions abi-compat/suppressions.abignore --no-added-syms ``` -------------------------------- ### Specify origin hint for configuration file Source: https://github.com/canonical/netplan/blob/main/doc/netplan-set.md Defines the filename for the generated YAML configuration. ```bash 70-netplan-set => /etc/netplan/70-netplan-set.yaml ``` -------------------------------- ### Check Documentation for Non-Inclusive Language Source: https://github.com/canonical/netplan/blob/main/doc/contribute-docs.md Use the 'make woke' command to scan the documentation for any non-inclusive language. ```bash make woke ``` -------------------------------- ### Apply sysctl Configuration Changes Source: https://github.com/canonical/netplan/blob/main/doc/reuse/configure-vm-disable-netfilter.md Execute this command to apply the changes made to `/etc/sysctl.conf` immediately without requiring a system reboot. ```shell sysctl -p /etc/sysctl.conf ``` -------------------------------- ### Generate ABI Reference with abidw Source: https://github.com/canonical/netplan/blob/main/abi-compat/README.md Use the `abidw` tool to generate an ABI XML reference file. This is typically done after building the library. ```bash meson setup _build --prefix=/usr meson compile -C _build abidw _build/src/libnetplan.so.1 --headers-dir include/ --header-file src/abi.h > abi-compat/noble_1.1.xml ```