Introduce
安装虚拟机无法DHCP获取地址,搜了点资料设置成功,记下来以后好找文档。
设置静态IP
vi /etc/network/interfaces
# The primary network interface
auto eth0 #表示让网卡开机自动挂载eth0
iface eth0 inet static
address 192.168.2.1
gateway 192.168.2.254
netmask 255.255.255.0
/etc/init.d/networking restart
设置DNS
vi /etc/resolvconf/resolv.conf.d/base
#添加
nameserver 8.8.8.8
nameserver 8.8.4.4
resolvconf -u
原文地址:http://blog.51cto.com/superxing/2093026
时间: 2024-12-11 06:19:11