1.查看当前网络ip
ifconfig
2.修改IP地址
vim /etc/sysconfig/network-scripts/ifcfg-ens33
修改为以下内容:
:wq保存退出
3.重启网卡,执行systemctl restart network命令
systemctl restart network
如果报错,执行reboot命令,重启虚拟机。
4.检查网络是否可以ping通,以百度为例
1.查看当前网络ip
ifconfig
2.修改IP地址
vim /etc/sysconfig/network-scripts/ifcfg-ens33
修改为以下内容:
:wq保存退出
3.重启网卡,执行systemctl restart network命令
systemctl restart network
如果报错,执行reboot命令,重启虚拟机。
4.检查网络是否可以ping通,以百度为例