Solve centos7 without installing the ifconfig command

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.