先查看本机的dns。
设置虚拟机nat模式的时候,dns设置成本机一样的。
编辑虚拟机网络地址的时候,dns也设置成和物理机一样。
再虚拟机ifconfig 要能看到对应的网卡比如ens33有对应的inet熟悉
inet 192.168.100.10
重启网络的时候可能执行失败,要
[root@localhost ~]# chkconfig NetworkManager off
[root@localhost ~]# chkconfig network on
[root@localhost ~]# service NetworkManager stop
关闭相关网络管理服务后再重启网络:
service network restart