The ifconfig command is a program that sets or displays network interfaces and displays the Nic information of our machine. However, in some cases, commands such as ifconfig are not installed by default when CentOS and other Linux releases are minimized, at this time, when you enter the terminal and run the ifconfig command, an error will occur. this is the first thing we will think about is whether the environment variable does not have the ifconfig command path, because ifconfig is in the/sbin path, it can run only when logged on as the root user, but we
The ifconfig command is a program that sets or displays network interfaces and displays the Nic information of our machine. However, in some cases, commands such as ifconfig are not installed by default when CentOS and other Linux releases are minimized, when you enter the terminal, an error occurs when running the ifconfig command.
This is the first thing we will think about is whether the environment variable does not have the ifconfig command path, because ifconfig is in the/sbin path and can be run only after the root user logs on, but we logged on as the root user. Don't worry. let's take a look at the root user's environment variables.
No. our environment variables include the/sbin path. Also, if the ifconfig command exists and is located in the/sbin Directory, we can certainly run it, so let's see if there is any ifconfig command in the/sbin directory.
The result shows that our/sbin directory does not have the ifconfig command, so our conclusion is: ifconf is not installed in CentOS.
--------------- The split line is an attitude ---------------
Our solution is: install the ifconfig command package in yum.
See It, bash is also split line, of course this is not in the focus, the focus is through the yum search command we found that the ifconfig command is in the net-tools.x86_64 of this package, next we will install this package.
Here we have installed the ifconfig command. let's try it.
After the command is run successfully, do you have the same questions as I did at the beginning? why is it not necessary to install the ipconfig command in windows when it comes to linux, the ifconfig command is originally from net-tools, which contains ifconfig, netstat, whois, and other commands. Therefore, you cannot run these commands before.