虚拟机系统ubuntu 16.04 设置桥接上网

1.vmware设置桥接


选择桥连接,网卡选择客户机所使用的网卡,我使用的是无线网卡

2.进入虚拟机设置静态ip和dns

1.设置ip地址

vi /etc/network/interfaces

添加如下内容:

# enp3s是你虚拟机的网卡,可以通过ifconfig查看
auto enp3s
iface enp3s inet static
#ip
address 192.168.1.102
# 子网和网关
netmask 255.255.255.0
gateway 192.168.1.1
 

2.设置dns(注意要和客户机保持一致)

 vi /etc/resolvconf/resolv.conf.d/base
nameserver 218.3.3.3
nameserver 218.5.5.5

3.重启虚拟机即可

猜你喜欢

转载自blog.csdn.net/jf_xu/article/details/78174134
今日推荐