After installing the virtual machine, the system networking problem in the virtual machine, don't talk nonsense, just go to the picture above!
first step
Second step
Step 3: Open CentOS and open the terminal
Use the vi editor to modify /etc/sysconfig/network-scripts/ifcfg-eth0 to
enter the /etc/sysconfig/network-scripts directory
cd /etc/sysconfig/network-scripts to open the configuration file
vi ifcfg-ens33 here may your file name is not This, but just look for ifcfg-ens in front
. Change ONBOOT=no in the file to ONBOOT=yes, then save and exit
Insufficient permissions
When the permissions are insufficient, the configuration file is read-only and cannot be modified. We must enter the root account to modify the configuration file.
su root
// 然后填写root账户密码,就进入了root用户
Modify common command lines
Take file.text as an example and step-by-step demonstration
// 1、查看文件
cat file.text
// 2、进入文件
vi file.text
/*3、进入到编辑模式,按键i,此时可以移动光标到想修改的位置,
同时我们修改内容如下:(注意界面左下角进入到了insert的模式,
才代表现在是编辑模式)*/
/*4、推出编辑模式,并保存,按键esc退出insert模式,
然后按shift+: (shift+冒号键),然后输入wq,wq表示,保存并退出。
如果只按键q,则是只退出不保存。*/
// 5、按 enter键退出界面