The premise is that centos can access the Internet and the network card can be found. 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 occurs. First, we will consider whether the path of the ifconfig command is not in the environment variable, because ifconfig is
The premise is that centos can access the Internet and the network card can be found.
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.
First, we will think about whether the ifconfig command path is not in the environment variable, because ifconfig is in the/sbin path and can be run only when 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.
Our solution is: install the ifconfig command package in yum.
Through the yum search command we found that the ifconfig command is in the net-tools.x86_64 package, then we will install this package on the line
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.