Ubuntu Vmware使用 nat 设置网络【实践版,有图】

来源:互联网 发布:网络视频会议系统品牌 编辑:程序博客网 时间:2024/05/17 00:16

http://tompig.iteye.com/blog/1113023

Ubuntu Vmware使用 nat 设置网络

1、设置方式: 

虚拟机设置成如下方式:

 Ubuntu Vmware使用 nat 设置网络

 第二步:设置虚拟网卡

  

 

第三步:

使用命令设置ubuntu的ip地址

liujicheng@ubuntu-liu:/etc/network$ sudo vi interfaces

 

设置成如下:

iface eth0 inet static
address 192.168.224.4
netmask 255.255.255.0
gateway 192.168.224.2
auto eth0

 

然后保存

 

第四步:

liujicheng@ubuntu-liu:/etc$ touch resolv.conf

如果文件不存在就建立,建立文件时提示

“touch: 无法创建"resolv.conf": 权限不够”

则切换root用户: 使用

liujicheng@ubuntu-liu:/etc$ su root
密码:

 在etc 下

sudo vi  resolv.conf 里面写入:

nameserver 192.168.224.2

 

然后保存,重启服务

 /etc/init.d/networking restart

 

第五步: 这是windows

 

 

 

 

到此为止设置完成。

 

 最后别忘记了 看windows机器的 dhcp 服务和nat 的服务 是否开启了

如下图: