记录一下配置静态IP过程,虚拟机VMware ---- PC端系统Win10 ------ 虚拟机系统Ubuntu 16.04
1、虚拟机的配置
2、配置PC端网络配置
网卡设置,打开“网络和Internet”设置→ 更改适配器设置→,在VMware Network Adapter VMnet8上单击右键,选择属性按钮打开属性对话框。
3、进入虚拟机的系统,设置固定Ubuntu的IP地址
3.1 进入虚拟机后,打开终端使用ifconfig命令查看网卡名称
3.2 配置网卡为静态IP
sudo vim /etc/network/interfaces
注:这是ubuntu系统的指令,如果是其他系统的仅供参考
auto ens33
iface ens33 inet static
address 192.168.61.100
netmask 255.255.255.0
gateway 192.168.61.1
dns-nameservers 8.8.8.8 114.114.114.114
auto ens33 #网卡名 根据3.1查看的信息设置
iface ens33 inet static #设置为静态
address 192.168.61.100 #IP地址
netmask 255.255.255.0 #子网掩码
gateway 192.168.61.1 #网关
dns-nameserver 8.8.8.8 114.114.114.114 #DNS服务器
3.3 重新启动网卡
sudo /etc/init.d/networking restart
3.4 测试网络是否可用,ping一下百度
ping www.baidu.com
收工,配置结束
温馨提示