How to Add a New Ethernet Conncection using nmcli

To add a new connection, you can use the following command:

Syntax:

nmcli connection add type <connection_type> ifname <interface_name> con-name <connection_name>

Here,

  • connection_type: Specifies the type of connection (e.g., ethernet, wifi).
  • interface_name: The name of the network interface.
  • connection_name: A user-defined name for the new connection.

Example:

nmcli connection add type ethernet ifname eth1 con-name my_eth_connection

This command creates a new Ethernet connection named “my_eth_connection” associated with the network interface “eth1”. Adjust the interface name and connection name as needed.

Adding new ethernet connection

To verify we can use this command “nmcli connection show”

nmcli connection show

Manage Network Connections From the Linux Command Line with nmcli

Network connectivity is a critical aspect of modern computing, and Linux provides a robust command-line tool for managing network connections: nmcli. Network Manager Command-Line Interface (nmcli) is a powerful and versatile utility that allows users to control and configure network settings directly from the terminal. In this article, we will delve into the syntax, usage, and various capabilities of nmcli for efficient network management on Linux.

Table of Content

  • What is nmcli
  • Syntax of nmcli
  • Pratical Implementation of nmcli Command in linux
  • 1. How to View Connections using nmcli
  • 2. How to Check the Device Status using nmcli
  • 3. How to Display Device Details using nmcli
  • 4. How to Add a New Ethernet Conncection using nmcli
  • 5. How to Adjust Connection Settings using nmcli
  • Options Available in nmcli Command in Linux

Similar Reads

What is nmcli

nmcli is a command-line tool which is used for controlling NetworkManager. nmcli command can also be used to display network device status, create, edit, activate/deactivate, and delete network connections....

Syntax of nmcli

The nmcli command follows a specific syntax, enabling users to interact with Network Manager through the command line. The general syntax for nmcli is as follows:...

Pratical Implementation of nmcli Command in linux

1. How to View Connections using nmcli...

1. How to View Connections using nmcli

nmcli connection show...

2. How to Check the Device Status using nmcli

To check the device status using nmcli command....

3. How to Display Device Details using nmcli

Syntax:...

4. How to Add a New Ethernet Conncection using nmcli

To add a new connection, you can use the following command:...

5. How to Adjust Connection Settings using nmcli

To modify connection settings, you can use the following command:...

Options Available in nmcli Command in Linux

Options Description -t, –terse Terse output suitable for script processing. -p, –pretty Prints organized and human-readable output. -m, –mode Switches between tabular and multiline output. Defaults to tabular if not specified. -f, –fields Specifies fields to print as output. Use ‘all’ for all fields or ‘common’ for common fields. -e, –escape Escapes column separators in values. -v, –version Displays version information. -h, –help Prints help-related information....

Conclusion

In this article we discussed nmcli which is a powerful command-line tool for managing network connections in Linux. With a structured syntax, it enables users to control and configure network settings efficiently. This article covered practical examples, including viewing connections, checking device status, displaying device details, adding new Ethernet connections, and adjusting settings. Key options such as terse, pretty, mode, fields, escape, version, and help were highlighted, showcasing the versatility of nmcli for diverse network administration tasks. Whether used in scripts or on headless machines, nmcli proves essential for streamlined and efficient network connectivity on Linux systems....