CentOS

How To Disable the Network Interface on Boot in CentOS 8

Almost all the Linux distributions are challenging and fun to us. However, what fun is there without a network interface that includes streaming files, browsing the web, and watching videos? The network interface is a software interface to the network hardware. This article covers everything required to disable a network interface on boot in CentOS 8.

Disabling a Network Interface on Boot in CentOS 8

  • ifconfig command is used to either display or config a network interface.
  • The IP address is, in simple words, called the digital address of any internet-connected device on the planet, and it is unique for every device with a string of numbers ranging between 0 to 255.
  • Gateway or LAN is required to connect the network to the system to communicate.

Now we move on to the process of disabling the network interface:

  • To create an interface, use the following command (it is not necessary most of the time):
ifconfig eth0 192.168.2.1 netmask 255.255.255.0 up
  • The first step would be to use the following command in the terminal to check and assign the IP address. Be very careful as the Linux’s terminal is case sensitive.
ifconfig
  • Now, we will use the following command to get more information, i.e., information about active and inactive interfaces:
ifconfig -a
  • Now, to see a table of all network interfaces, we will use the following command:
netstat -i
  • Once you see the network named “eth0”, we will need to enable it by using one of the following commands:
ifconfig eth0 up

Or

ifup eth0
  • Then, to deactivate it, use one of the following commands:
ifconfig eth0 down

or

ifdown eth0

Note: Depending on your NIC (Network interface controller), there can be multiple ports. You can select any of them to be disabled individually. For example, if you want to disable “eth1”, then you would execute the following command:

ifconfig eth1 down

or

ifdown eth1

 

Disabling and Enabling the Whole Network or All Interfaces

  • The following commands can be used if you want to disable all incoming and outgoing remote connections on all of your network interfaces:
/etc/init.d/network stop
  • Now, when you have disabled them, then you can enable them again using the following command:
/etc/init.d/network start

Note: Disabling and Enabling the network requires a password that is the same as your user password. Once you’ve entered the correct password, you will see the [ ok ] in front of your command in the terminal.

Conclusion

We simplified the process of disabling the network interface, the use of the network interface, and the working of the network interface. We also elaborated on the commands that can be used to disable all network interfaces and then enable them. Our team hopes this article will help you, and please visit our website for more valuable articles that can help you in almost every aspect of Linux.

Similar Posts