最近学习Linux系统时,主机连接wife 虚拟机上不了网,问题解决 在网上看了一些教程,总结了一下步骤,如何解决问题Linux连不上网问题: 第一步:打开电脑上控制面板里的网络与链接  找到:里面的更改适配器设置  进入后点击他的属性修改  如下:  第二步: win+r 输入 cmd 打开windows终端输入ipconfig回车。找到自己的网络ip地址里面找到ipv4的ip,和默认网关:  
第三步 打开VMnet8 的属性找到 tcp/ipv4点击属性把ip地址设置成 你无线局域网的默认网关
 第四步: 找到虚拟机的编辑 找到虚拟网络编辑器 点开   之后  最后打开打开Linux的终端 输入: cat /etc/sysconfig/network-scripts/ifcfg-ens33 如果提示 找不到 可以先 cd … 或 cd / 试试,可能是文件路径不对 还是不行,就在网上搜一下,网卡的具体配置文件 可能 有些不一样 修改里面的配置参数:  第五步,重启Linux系统网络 service network restart 第六步 输入指令编辑文件: vi /etc/resolv.conf 编辑如下内容: nameserver 8.8.8.8 nameserver 8.8.4.4 search localdomain  提醒一下 我图片里的 ip地址(192.168.217)是我自己之前就改好的,你们要改成你们自己电脑的ip地址哟 最后重启虚拟机就可以继续上网了! 可以上网后,以后无论连接谁的wife都不用改相关配置,可以直接上网 以上文件内容是借鉴于 该博主+上自己总结的经验:具体详情页面
|