Este contenido no está disponible en el idioma seleccionado.
Chapter 46. Using nmstate-autoconf to automatically configure the network state using LLDP
Network devices can use the Link Layer Discovery Protocol (LLDP) to advertise their identity, capabilities, and neighbors in a LAN. The nmstate-autoconf utility can use this information to automatically configure local network interfaces.
The nmstate-autoconf utility is provided as a Technology Preview only. Technology Preview features are not supported with Red Hat production Service Level Agreements (SLAs), might not be functionally complete, and Red Hat does not recommend using them for production. These previews provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer Portal for information about the support scope for Technology Preview features.
46.1. Using nmstate-autoconf to automatically configure network interfaces Copiar enlaceEnlace copiado en el portapapeles!
The nmstate-autoconf utility uses LLDP to identify the VLAN settings of interfaces connected to a switch to configure local devices.
This procedure assumes the following scenario and that the switch broadcasts the VLAN settings using LLDP:
-
The
enp1s0andenp2s0interfaces of the RHEL server are connected to switch ports that are configured with VLAN ID100and VLAN nameprod-net. -
The
enp3s0interface of the RHEL server is connected to a switch port that is configured with VLAN ID200and VLAN namemgmt-net.
The nmstate-autoconf utility then uses this information to create the following interfaces on the server:
-
bond100- A bond interface withenp1s0andenp2s0as ports. -
prod-net- A VLAN interface on top ofbond100with VLAN ID100. -
mgmt-net- A VLAN interface on top ofenp3s0with VLAN ID200
If you connect multiple network interfaces to different switch ports for which LLDP broadcasts the same VLAN ID, nmstate-autoconf creates a bond with these interfaces and, additionally, configures the common VLAN ID on top of it.
Prerequisites
-
The
nmstatepackage is installed. - LLDP is enabled on the network switch.
- The Ethernet interfaces are up.
Procedure
Enable LLDP on the Ethernet interfaces:
Create a YAML file, for example
~/enable-lldp.yml, with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the settings to the system:
nmstatectl apply ~/enable-lldp.yml
# nmstatectl apply ~/enable-lldp.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure the network interfaces using LLDP:
Optional, start a dry-run to display and verify the YAML configuration that
nmstate-autoconfgenerates:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use
nmstate-autoconfto generate the configuration based on information received from LLDP, and apply the settings to the system:nmstate-autoconf enp1s0,enp2s0,enp3s0
# nmstate-autoconf enp1s0,enp2s0,enp3s0Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Next steps
If there is no DHCP server in your network that provides the IP settings to the interfaces, configure them manual. For details, see:
Verification
Display the settings of the individual interfaces:
nmstatectl show <interface_name>
# nmstatectl show <interface_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow