Forrest logo
back to the nmcli tool

nmcli-connection:tldr:2990a

nmcli-connection: Create an auto-configured dual stack connection.
$ nmcli connection add ifname ${interface_name} type ${ethernet} ipv4.method ${auto} ipv6.method ${auto}
try on your machine

The command you provided is used to add a new network connection using the "nmcli" command-line tool in Linux systems. Here is the breakdown of each part of the command:

  1. nmcli connection add: This is the main command used to create a new network connection.

  2. ifname ${interface_name}: This part specifies the name of the network interface to which you want to add the connection. You need to replace ${interface_name} with the actual name of the interface, such as eth0 or enp0s3.

  3. type ${ethernet}: Here, you define the type of connection you want to create. ${ethernet} should be replaced with the connection type. In your command, it is set as "ethernet," indicating a wired Ethernet connection.

  4. ipv4.method ${auto}: This part specifies the IPv4 configuration method for the network connection. ${auto} is used to set the method to "automatic." It means that the connection will use DHCP (Dynamic Host Configuration Protocol) to obtain an IP address for the interface automatically.

  5. ipv6.method ${auto}: Similar to the previous point, this section determines the IPv6 configuration method. ${auto} sets it to "automatic," which means that IPv6 configuration will also be obtained through DHCP.

Overall, this command creates a new network connection using the "nmcli" tool, assigns it to a specific network interface, sets the connection type as Ethernet, and configures both IPv4 and IPv6 methods as automatic, enabling DHCP for both protocols.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nmcli tool