CentOS

How to Disable a Network Interface on Boot in CentOS 8

At times, your system uses several different network interfaces. However, in some situations, you might need any one of them to be disabled temporarily so that the other one can work properly. Therefore, in this article, we will teach you the method of disabling a specific network interface on boot in CentOS 8.

Method to Disable a Network Interface on Boot in CentOS 8

To disable a network interface on boot in CentOS 8, you have to perform the following steps:

Step #1: Checking the Active and Inactive Network Interfaces

First, we list down all the active and inactive network interfaces on our CentOS 8 system so that we can pick the one that we want to disable on boot. For that, we use the following command:

1
$ ifconfig –a

All the network interfaces of our CentOS 8 system are shown in the following image:

Step #2: Checking the Information of a Particular Network Interface

We want to disable the “enp0s3” network interface on boot. Therefore, we only list down the information particular to this network interface with the help of the following command:

1
$ ifconfig enp0s3

You can see in the output of this command shown in the following image that this particular network interface is up and running at the moment.

Step #3: Disabling a Specific Network Interface on Boot

To disable the specified network interface on boot, we use the following command:

1
$ sudo ifconfig enp0s3 down

After providing the “sudo” password, you will be able to execute this command successfully as shown in the following image:

Step #4: Verifying If the Specified Network Interface Has Been Disabled Or Not

To verify whether the specified network interface has been disabled successfully or not, we will run the command used in the second step. You can verify from the output of this command that is shown in the following image that the up and running status has disappeared. This means that our specified network interface has been disabled successfully.

Pro-Tip:

If you wish to re-enable the network interface that you have just disabled, you can use the following command:

1
$ sudo ifconfig enp0s3 up

Conclusion

By going through this article, you will instantly learn the method of disabling a network interface on boot in CentOS 8. You can then disable any desired network interface at any time you want while working with CentOS 8. Moreover, if you have accidentally disabled a network interface, then you can conveniently re-enable it by following the pro-tip that is shared in this article.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.