Note: This is an advanced feature which requires deep understanding of Talos and Linux network configuration.Talos Linux when running on a cloud platform (e.g. AWS or Azure), uses the platform-provided metadata server to provide initial network configuration to the node. When running on bare-metal, there is no metadata server, so there are several options to provide initial network configuration (before machine configuration is acquired):
- use automatic network configuration via DHCP (Talos default)
- use initial boot kernel command line parameters to configure networking
- use automatic network configuration via DHCP just enough to fetch machine configuration and then use machine configuration to set desired advanced configuration.
META-based network configuration.
Note:Talos dashboard provides a way to configureMETA-based network configuration is only available on Talos Linuxmetalplatform.
META-based network configuration for a machine using the console, but
it doesn’t support all kinds of network configuration.
Network Configuration Format
TalosMETA-based network configuration is a YAML file with the following format:
*Spec resource .spec part, e.g the addresses:
section matches the .spec of AddressSpec resource:
Addresses
The addresses configured are usually routable IP addresses assigned to the machine, so thescope: should be set to global and flags: to permanent.
Additionally, family: should be set to either inet4 or inet6 depending on the address family.
The linkName: property should match the name of the link the address is assigned to, it might be a physical link,
e.g. en9sp0, or the name of a logical link, e.g. bond0, created in the links: section.
Example, IPv4 address:
Links
For physical network interfaces (links), the most usual configuration is to bring the link up:links: section is not important.
Bonds
For bonded links, there should be a link resource for the bond itself, and a link resource for each enslaved link:logical: true- this is a logical link, not a physical onekind: bond- this is a bonded linktype: ether- this is an Ethernet linkbondMaster:- defines bond configuration, please see Linux documentation on the available options
masterName: bond0- the name of the bond this link is enslaved toslaveIndex: 0- the index of the enslaved link, starting from 0, controls the order of bond slaves
VLANs
VLANs are logical links which have a parent link, and a VLAN ID and protocol:logical: true- this is a logical link, not a physical onekind: vlan- this is a VLAN linktype: ether- this is an Ethernet linkparentName: bond0- the name of the parent linkvlan:- defines VLAN configuration:vlanIDandvlanProtocol
Routes
For route configuration, most of the timetable: main, scope: global, type: unicast and protocol: static are used.
The route most important fields are:
dst:defines the destination network, if left empty means “default gateway”gateway:defines the gateway addresspriority:defines the route priority (metric), lower values are preferred for the samedst:networkoutLinkName:defines the name of the link the route is associated withsrc:sets the source address for the route (optional)
family: should be set to either inet4 or inet6 depending on the address family.
Example, IPv6 default gateway:
10/8 via 10.68.182.0 gateway:
Hostnames
Even though the section supports multiple hostnames, only a single one should be used:domainname: is optional.
If the hostname is not set, Talos will use default generated hostname.
Resolvers
Theresolvers: section is used to configure DNS resolvers, only single entry should be used:
dnsServers: is not set, Talos will use default DNS servers.
Time Servers
ThetimeServers: section is used to configure NTP time servers, only single entry should be used:
timeServers: is not set, Talos will use default NTP servers.
Supplying META Network Configuration
Once the network configuration YAML document is ready, it can be supplied to Talos in one of the following ways:
- for a running Talos machine, using Talos API (requires already established network connectivity)
- for Talos disk images, it can be embedded into the image
- for ISO/PXE boot methods, it can be supplied via kernel command line parameters as an environment variable
META partition under the key 0xa (decimal 10).
In this guide we will assume that the prepared network configuration is stored in the file network.yaml.
Note: as JSON is a subset of YAML, the network configuration can be also supplied as a JSON document.
Supplying Network Configuration to a Running Talos Machine
Use thetalosctl to write a network configuration to a running Talos machine:
Supplying Network Configuration to a Talos Disk Image
Following the boot assets guide, create a disk image passing the network configuration as a--meta flag:
Supplying Network Configuration to a Talos ISO/PXE Boot
As there is noMETA partition created yet before Talos Linux is installed, META values can be set as an environment variable INSTALLER_META_BASE64 passed to the initial boot of Talos.
The supplied value will be used immediately, and also it will be written to the META partition once Talos is installed.
When using imager to create the ISO, the INSTALLER_META_BASE64 environment variable will be automatically generated from the --meta flag:
When PXE booting, the value of INSTALLER_META_BASE64 should be set manually:
INSTALLER_META_BASE64 to the initial boot of Talos: talos.environment=INSTALLER_META_BASE64=<base64-encoded value>.
Getting Current META Network Configuration
Talos exports META keys as resources: