1. Problem: I just installed centos7 at the minimum and want to check the local IP address. Then run ifconfig, and an error popped up as a result.
2. Troubleshooting: First of all, we understand whether it is caused by not turning on the network card? We can check through the following 3 methods;
1) Ping Baidu to find out whether the network card is enabled
2) Confirm whether the network card is enabled by entering ip addr to check whether the IP address can be obtained
3) Through cat /etc/sysconfig/network-scripts/ifcfg-enp0s3 (ifcfg-enp0s3 is the name of the network card, different machines are different.) Whether NBOOT is turned on (meaning whether the network card is turned on).
3. Conclusion of troubleshooting
1) If it can be pinged, it means that the network card is enabled and can obtain an IP address to access the Internet. (If not, you can use vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 to change ONBOOT to yes. Change BOOTPROTO to dhcp, or to obtain the IP address manually, see Centos7 network configuration for details) Note: After modification Need to restart the network card (command: service network restart)
2) The obtained IP address can be checked through ip addr, which proves that the network card is enabled. If you can’t get it, please modify the network configuration file. Note: You need to restart the network card after modification (command: service network restart)
3) Check whether the network card is enabled through cat /etc/sysconfig/network-scripts/ifcfg-enp0s3, if not, use vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 to modify the network configuration file.
Summary: At this time, it can be determined that ifconfig related tools are not installed.
4. Use yum provides ifconfig to check which package to improve ifconfig, and install it.
Then execute yum install net-tools
Then enter: ifconfig command to test
The version of the net-tools package can be displayed here, and the information related to the IP address can be viewed.
Read More:
- Error report when executing ifconfig under centos7
- Centos8 Could not restart the Network: Failed to restart network.service: Unit network.service not found
- Centos7 Error: initramfs not found
- arm-eabi-gcc: command not found [How to Solve]
- -bash: sqlplus: command not found [How to Solve]
- ./configure Command Execute error (Centos7 Install erlang)
- Error in Linux running file: bash: $’\r’: command not found
- [Solved] Linux Mongodb Error: # Error: coul-bash: connecting: command not found
- Mac opens Terminal and reports an error -bash:: command not found
- How to Solve Linux Error: -bash: unzip: command not found
- Git commit – M ‘upload submit times error command “husky run” not found.
- [Solved] G++ Error: Command ‘g++‘ not found, but can be installed with:
- Linux Install Bee and Execute Error: bash: bee: command not found
- MAC Adb Shell Error: -bash: adb: command not found, adb
- [Solved] CentOS Start Neo4j Database Error: Error: A JNI error has occurred, please check your installation and try again
- [Solved] ERROR: Subproject directory not found and gst-plugins-base.wrap file not found
- [Solved] zookeeper Cluster error: Error: JAVA_HOME is not set and java could not be found in PATH.
- [Solved] Error reported using telnet command in Centos7: telnet: error while loading shared libraries: libtinfo.so.6
- [Solved] websocket: the client is not using the websocket protocol: ‘upgrade’ token not found in ‘Connection’ head
- linux Ubuntu Error: No command ‘setenv‘ found