Linux ubuntu虚拟机连接上网总结

1.首先查看主机的ip信息

ipconfig /all



2.修改ubuntu中/etc/network/interfaces文件

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 172.16.129.101
netmask 255.255.254.0
gateway 172.16.129.254




3.修改/etc/resolvconf/resolv.conf.d/base配置DNS

nameserver 172.16.6.11 # 必须与主机的一致


猜你喜欢

转载自forlan.iteye.com/blog/2372788