Note the 'optional: true' key declarations that allow booting to occur without waiting for those interfaces to activate fully. Below is an example of an active-backup bond that uses DHCP to obtain an address: network:īelow is an example of a system acting as a router with various bonded interfaces and different types. You can also delegate all configuration of the network to Network Manager itself by specifying only the renderer key: network:īonding is configured by declaring a bond interface with a list of physical interfaces and a bonding mode. You can specify which network backend should be used to configure particular devices by using the renderer key. Netplan supports both networkd and Network Manager as backends. In this case, the default route for that address will be automatically configured with a metric value of 100. The metric value should be adjusted so the routing happens as expected.ĭHCP can be used to receive one of the IP addresses for the interface. We configure individual routes to default (or 0.0.0.0/0) using the address of the gateway for the subnet. Similar to the example above, interfaces with multiple addresses can beĬonfigured with multiple gateways. Using multiple addresses with multiple gateways The addresses key can take a list of addresses to assign to an interface: network: Using multiple addresses on a single interface Many different modes of encryption are supported. Or, if the network is secured using WPA-EAP and TLS: network:Īnonymous-identity: /etc/ssl/cust-cacrt.pemĬlient-certificate: /etc/ssl/cust-crt.pem It is also common to find wireless networks secured using WPA or WPA2 Enterprise, which requires additional authentication parameters.įor example, if the network is secured using WPA-EAP and TTLS: network: The wireless access point name and password should also be specified: network:Ĭonnecting to WPA Enterprise wireless networks Wireless devices use the 'wifis' key and share the same configuration options with wired ethernet devices. Netplan easily supports connecting to an open wireless network (one that is not secured by a password), only requiring that the access point is defined: network:Ĭonnecting to a WPA Personal wireless network In this example, 'enred' is preferred over 'engreen', as it has a lower route metric: network: One can achieve the exact routing desired over DHCP by specifying a metric for the routes retrieved over DHCP, which will ensure some routes are preferred over others. Servers will commonly need to connect to multiple networks, and may require that traffic to the Internet goes through a specific interface despite all of them providing a valid gateway. Many systems now include more than one network interface. DNS information can be provided as well, and the gateway can be defined via a default route: network: To instead set a static IP address, use the addresses key, which takes a list of (IPv4 or IPv6), addresses along with the subnet prefix length (e.g. To let the interface named 'enp3s0' get an address via DHCP, create a YAML file with the following: network: Configuration written to disk under /etc/netplan/ will persist between reboots. This command parses and applies the configuration to the system. etc/netplan/config.yaml), then run sudo netplan apply. To configure netplan, save configuration files under /etc/netplan/ with a. If you see a scenario missing or have one to contribute, please file a bug against this documentation with the example using the links at the bottom of this page. Below are a collection of example netplan configurations for common scenarios.
0 Comments
Leave a Reply. |