Introduction
This article is informing on how to configure a network interface so that it will be active on boot process. It works in Linux CentOS 8 operating system. Without having to activate the network interface using a command, it will automatically active. The following is a step to configure network interface available in a virtual server. So, the example in this context is a virtual server running in a VirtualBox application. The virtual server is running in a CentOS 8 operating system. In order to know how the environment of the virtual server is available, just read the article ‘How to Install CentOS 8 in VirtualBox running in Microsoft Windows 10’ in this link. Actually, the VirtualBox application can run in any operating system.
Network Interface Configuration to start it on boot process
In order to configure the network interface, there are several parts available to achieve it. The first part is where the beginning part to access the virtual server. Accessing the server can be directly access by running it from the VirtualBox application if it is a virtual server. Another method is by accessing through SSH connection. The next part is the continuation part where the configuration start. The configuration process consists of editing the suitable file of the network interface.
Accessing Virtual Server
So, the following are the steps to configure the network interface so that it will automatically start without executing any command :
1. Start the VirtualBox application as in the following image :
2. Start the virtual server. In the above case, it is the virtual server with the label of CentOS-8 as follows :
3. Just login to the virtual server using a super user account. Another way is by using a normal user. Later on, it can switch to a super user account to configure the network interface. For configuring a user that can switch to a super user account, just read the article with the title ‘How to Add User as Super User in CentOS 8 running in a VirtualBox Application’ in this link. Accessing the virtual server can also possible using SSH connection. Just read the article ‘How to Remote CentOS Virtual Server running in a VirtualBox with a NAT Network using SSH’ in this link to access the virtual server using SSH connection.
4. As soon as accessing the virtual server is a success, make user the user has the privilege for further configuration. List all of the available interface.
So, the command is ‘ifconfig’. The above image is showing a process accessing the virtual server using SSH connection. There are several network interface available. Just select the main network interface where in the this context it is the one with the label of ‘enp0s3’. It is the network interface that is attached to a NAT connection type.
Configuring Network Interface by editing the associated file
1. Edit the network interface file with the label of ‘enp0s3’ by executing the following command :
vi /etc/sysconfig/network-scripts/ifcfg-xxxxxxx
The ‘xxxxxxx’ in the above context is ‘enp0s3’. Just adjust it with the label name of the network interface available in the virtual server. The following image will appear :
2. In the above image, there is a parameter wit the name of ‘ONBOOT’ with the value of ‘no’. Just change it into ‘yes’. Make sure that the file is possible for further editing. Open it by a super user account or use the ‘sudo’ command as a normal user to edit. it. As in the following command :
3. Change the content of the file as follows :
4. Do not forget to restart the virtual server. Make sure that it is already activate without having to execute an additional command to activate it. The additional command for activating the network interface normally is ‘ifup xxxxxx’ where ‘xxxxxxx’ is the label of the network interface.