Network Manager
Network Manager aims for Network Connectivity which "Just Works". The computer should use the wired network connection when it's plugged in, but automatically switch to a wireless connection when the user unplugs it and walks away from the desk. Likewise, when the user plugs the computer back in, the computer should switch back to the wired connection. The user should, most times, not even notice that their connection has been managed for them; they should simply see uninterrupted network connectivity.
More information about Network Manager is available in Gnome website and wiki .
Installation
NetworkManager should be installed by default on Ubuntu Desktop installs, as well as most flavours of Ubuntu.
To install NetworkManager:
sudo apt install network-manager
Network Manager
Network Manager aims for Network Connectivity which "Just Works". The computer should use the wired network connection when it's plugged in, but automatically switch to a wireless connection when the user unplugs it and walks away from the desk. Likewise, when the user plugs the computer back in, the computer should switch back to the wired connection. The user should, most times, not even notice that their connection has been managed for them; they should simply see uninterrupted network connectivity.
More information about Network Manager is available in Gnome website and wiki .
Installation
NetworkManager should be installed by default on Ubuntu Desktop installs, as well as most flavours of Ubuntu.
To install NetworkManager:
sudo apt-get install network-manager
To install the GNOME applet / indicator:
sudo apt-get install network-manager-gnome
VPN support
Network Manager VPN support is based on a plug-in system. If you need VPN support via network manager you have to install one of the following packages:
network-manager-openvpn network-manager-vpnc network-manager-openconnect
The network-manager-pptp plugin is installed by default.
On GNOME, you also need to install the -gnome packages for the VPN plugin you choose:
network-manager-openvpn-gnome network-manager-vpnc-gnome network-manager-openconnect-gnome
Start
The steps to start NetworkManager depend on which of the initialization subsystems are running: Upstart or Systemd.
Using Upstart
Start network manager
sudo start network-manager
Using Systemd
Systemd became the default initialization system in Ubuntu 15.04. Here's how to start Network Manager and enable it to be restarted after a reboot:
Start network manager
sudo systemctl start NetworkManager
Enable restarting the network manager when the system reboots
sudo systemctl enable NetworkManager
Connection Types
To access the types of network connections, open gnome-control-center by typing "Settings" into the activities overview. Click the wheel icon to lauch the settings app (aka. gnome-control-center). When It launches you will see the network options in the top of the left panel: Wi-Fi and Network.
For more advanced usages, you can type "Network" into the activities overview, to launch the Network Connections application (app-gnome-nm).
Wired connections
This type of connection is one where you are connecting to the Internet through an Ethernet connection to some router/modem.
Wireless
This type of connection is one where one is connected to the Internet through a wireless card & base-station combo.
Mobile Broadband
This type of connection is similar to wireless, the only difference would be the hardware. Its normally based on a high-speed portable wireless card which may follow GPRS, 3G, WiMAX, UMTS/HSPA or/and EV-DO standards.
VPN
This type of connection is usually used by corporates to connect to their workplace via the internet or by universities to make special services available to their students and staff. Currently no more than one VPN connection at a time is supported (see here). The VPN packages are not installed by default. See VPN for how to do that.
Creating/Modifying a User connection
Hint: Making any change to an existing wired connection will only be applied after you restart NetworkManager or reboot your system. Changes will also be automatically applied if your change the Connection name of a connection.
So how do we add or modify a user connection? Let's start by adding a user connection. So we do the following steps:
a. Launch the Network Connections application by typing "Network" in the activities overview and clicking the "Advanced Networking" icon
b. Click the "+" icon to add a network connection, choose a connection type, and click "Create". We will be looking at all the 5 options in the network connections one by one as to what information needs to be filled up.
Adding Wired/Ethernet connections
Ethernet
Creating an Ethernet connection opens a new window with several tabs.
|
At the top one needs to give some name to the connection, by default it is showing as Ethernet Connection 1. You can either use that or make it something which is recognizable and easily remembered by you.
General tab
On the General tab there are two options with check-boxes just next to them. The first option asks whether you want network-manager to connect automatically or not. Clicking on that would make network-manager automatically try to resolve or making that connection happen for you. The second option allows all users of this machine to use the new ethernet connection.
|
Ethernet tab
On the Ethernet tab, you must choose a computer device capable of a wired connection.
|
There is also a field called "MAC address". The MAC (Media Access Control) address is a unique identifier for the Ethernet card/Network Interface card. The MAC address is written in the form of a set of 6 grouped hexadecimal digits, e.g. 01:23:45:67:89:AB.
To find out your MAC address you can run:
sudo ip addr
You will get something like this:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether '''00:08:c7:1b:8c:02''' brd ff:ff:ff:ff:ff:ff
802.1X Security tab
|
This tab is for secure communications where one wants to have port-based authentication using some authentication server. After checking the box to use 802.1x security for the connection, you have to choose which authenticated protocol to use from MD5, TLS, PWD, FAST, Tunneled TLS, or Protected EAP. You would also need to give some identity as well like choosing a user or/and some certifying authority's certificate. You would also need to give your private key particulars as well as a Private Key password. You may choose or not to show the password.
DCB tab
|
Data center bridging is availabe, just check the box and choose which features to enable.
Proxy tab
|
If you would like to setup proxy routing, you can select a method and import a script from a file.
IPv4/6 Settings tabs
|
This is perhaps the most interesting tab, where one has various options of connecting:
a. Automatic (DHCP)
b. Automatic (DHCP Addresses only)
c. Manual
d. Link-local only
e. Shared to other computers
f. Disabled
Ubuntu 23.10 and future releases
The NetworkManager available from Ubuntu 23.10 onwards, will include netplan. Netplan is a configuration abstraction layer aimed at making it more intuitive to write your network files. More netplan information can be found at netplan.io.
All the connection configuration files will be stored as yaml files here.
/etc/netplan
Issues
If it is not managing your network connections, then you can remove all of the .nmconnection files (except lo.nmconnection) listed in /run/NetworkManager/system-connections. Reboot and try to connect to whichever connection you're expecting to use (wifi or wired or something else). You can use the Settings UI tool, nmcli, or a text editor to write your connection files.
Ubuntu 23.04 and previous releases
All the connection configuration files will be stored as ini files here.
/etc/NetworkManager /etc/NetworkManager/system-connections
User settings are defined as files in those directories that include specific access controls to limit the access to a specific user.
Stopping and Disabling NetworkManager
Here's how to stop and disable Network Manager without uninstalling it (taken from AskUbuntu):
Stop network manager
sudo systemctl stop NetworkManager.service sudo systemctl stop NetworkManager-wait-online.service sudo systemctl stop NetworkManager-dispatcher.service sudo systemctl stop network-manager.service
Disable network manager (permanently) to avoid it restarting after a reboot
sudo systemctl disable NetworkManager.service sudo systemctl disable NetworkManager-wait-online.service sudo systemctl disable NetworkManager-dispatcher.service sudo systemctl disable network-manager.service
Editing Network Settings in nm-connection-editor
Nm-connection-editor is the configuration applet that provides easy access to advanced network settings and allows greater configuration options through a simple interface. To access nm-connection-editor, right-click on the network icon in the notification area and select Edit Connections...
Changing a network's encryption key
Nm-connection-editor enables you to easily update a network's encryption key by displaying the current key for each network and giving you the option of displaying it in clear text while you edit.
Ensuring connection to particular access points
You can specify a particular BSSID directly in nm-connection-editor. This means that in a wireless network with more than one access point, you can choose the one NetworkManager will connect to.
Using NetworkManager on the command line
NetworkManager now ships with nmcli, a simple interface to allow users to connect to particular networks, and even create connections to new wireless networks they have never connected to:
nmcli help
Provides all the information about how to use the nmcli utility.
Troubleshooting