Summary
After installing CentOS in the virtual machine, you need to know the IP of the CentOS, which is convenient for later connection.
View IP Commands
Command
Ifconfig
Can see the information, the instructions have been configured, if not configured, can be configured in the following way.
If you configure IP, you need to switch to root permissions, switch to the command line interface via CTRL+ALT+F2
CD to the directory of the network configuration file, and list the files under the directory.
cd/etc/sysconfig/network-scripts/
View Files
Ls
FileName
VI ifcfg-eno16777736
"Is the network configuration of the main file, open it by the following command
Need to configure IPADDR0=IP address, gatway0= Gateway, Dns=dns.
Edit End, by: Wq Save and exit
Restart Network Service
Service Network restart
View IP again
The IP of the local ping virtual machine
Summarize
Of course, this kind of command line is cumbersome, if there is an interface, you can set in the interface. But most of the servers are not interfaces. The command line is the only way.
Reference articles
Introduction to CentOS file viewing and editing
[Centos]ip operation