GUI( Graphical user interface way)
Most people are comfortable with the graphical user interface and in this article, we will also cover the GUI approach. Before we proceed you must have the Network Manager tool ( nmtui) so that you can follow the next steps. It can be installed by using the yum package manager.
sudo yum -y install NetworkManager-tui
Now that the Network Manager tool is installed follow the below steps to set the interface through GUI.
Step 1: Open the Network Manager:
After writing the below command a window will appear with some options.
nmtui
Step 2: Choose to edit a connection and select the link:
Step 3: Add the Network interface information:
In the above image, the IPv4 configuration is set to the manual which means it is for a static IP address, if you want to configure the network as DHCP set it to automatic.
Step 4: Check out a few essential boxes:
Make sure that the following checkboxes are ticked for the smooth function of the network.
Step 5: Save the changes, Exit, and restart the network service.
After all the changes have been made save them and restart the service so that the changes are applied.
service network restart
So this is how the network interfaces can be configured on the CentOS distro using the CLI as well as the GUI method. Hope you like the article.
How to configure network interfaces in CentOS?
A network interface is a link between a computer and another network(Private or Public). The network interface is basically a card which is known as NIC or Network Interface Card, this does not necessarily have to be in a physical form instead, it can be inbuilt into the software. If we take the example of some loopback addresses such as 127.0.0.1(IPv4) and ::1(IPv6), these are not in physical structure but they are pieces of code written on the system.
There are two ways to Configure network interfaces in CentOS:
- The Command line way
- GUI( Graphical user interface way)
Both ways will be discussed in the article. But before starting that let us first understand a little bit about how the Network Interface naming works so that the different network names don’t sound weird to us.
Network Interface naming
While naming the network interfaces, the virtual and physical aspects of them are considered. The names assigned to the physical networks are based on the slot number given on the adapter. Virtual interfaces are named by the combination of interface name and VLAN ID. The names of the physical interfaces are assigned on the basis of the slot where the adapter is installed. The physical interfaces are identified by the following format:
e <slot_number_on_adapter> <port_number_of_adapter>
Interface group names
These group names are user specifies and they must follow the below criteria:
- They should begin with a letter.
- Spaces are prohibited.
- More than 15 characters are not allowed.
- They must not be in use by any other interfaces.
The Format of the VLAN interface is as follows;
<name_of_physical_interface>-<vlan_ID> <ifgrp_name>-<ID_of_vlan>
Below are some examples of interface names, formats, and their examples:
- The physical interface on a single port adapter: e0,e1
- The physical interface on a multiple port adapter: e0c,e0d
- Interface group: web_ifgrp, ifgrp3
- VLAN: ifgrp1-2, e7-2
Now let us discuss the ways to configure the network interfaces.