DEV Community

Shubham Gupta
Shubham Gupta

Posted on

Manage Network Connections

Table of Contents

  1. What is network manager
  2. What is nmcli/nmtui
  3. What is a network device
  4. What is a connection
  5. How to view device status
  6. How to view active connection
  7. How to add/remove a connection

What is Network Manager ?

Network manager is a daemon in the Linux Kernnel that manages the device, connection etc. and keep them active. By default the network is handled by the system'd networkd and netplan but if NetworkManager is installed, it will take control of all networking.

Configuration of Network manger is present at : /etc/NetworkManager/NetworkManager.conf

What is nmcli/nmtui

So nmcli is command line tool that is used to control NetworkManager. nmcli command can also be used to manage the network device and network connection. Nmtui does the same work but in the graphical way.

What is a network device

Network Device is a hardware that allow you to communicate i.e. switch, hub, router, NIC ( Network interface card ) etc.

Here we are going to refer mostly network interface which is nothing but the software side of these hardware so that we can manage them.

To view the active network interface use : ifconfig -a

What is a network connection

A network connection is a connection between two network devices that are connected on the same network.

How to view device status

We can use nmcli device status to view the device status.

Image description

It would view us the current state of the device and the active connection on it if any.

How to view active connection

To view all connection we can use nmcli connection show and to get to only active connection we can add flag --active

image

How to add/remove a connection

To add a new connection we can use
nmcli connection add type <ethernet|wifi> ifname <device name> conn-name <connection name> <setting>.<property> <value>

image

Here we checked our devices that are present then we added a test-connection and verified that it was added.

To remove this connection we can simply use
nmcli connecion delete <conn-name>

image

Top comments (0)