一、虚拟机Ubunto10.04设置静态IP
step1:VMWare设置桥接:
VM->setting->NetworkAdapter->Bridged
step2:设置ip
gedit /etc/network/interfaces
文件内容修改为:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.152
gateway 192.168.0.1
netmask 255.255.255.0
network 192.168.0.1
step3:设置DNS
gedit /etc/resolv.conf
文件内容修改为:
# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 202.103.24.68
step4:
然后重启networking
/etc/init.d/networking restart
二、虚拟机Ubunto10.04设置DHCP动态IP
step1::VMWare设置桥接:
step2:
sudo gedit /etc/network/interfaces
修改为:
auto eth0
iface eth0 inet dhcp
setp3: 重启网络生效
sudo /etc/init.d/networking restart
或运行sudo dhclient eth0 生效