今天在虚拟机上安了个Ubuntu 7.10 ,默认是动态IP,静态IP需要手动设置,设置方法是:
sudo vi /etc/network/interfaces :
auto eth0
# iface eth0 inet dhcp
iface eht0 inet static
address 192.168.1.254
netmask 255.255.255.0
gateway 192.168.1.1
nameserver 192.168.1.1
sudo /etc/init.d/networking restart