2016发布的rasbian采用的网络机制是dhcpcd;
不能使用以前的修改配置文件/etc/network/interfaces;
新的配置方式保持/etc/network/interfaces
不变, 只需在/etc/dhcpcd.conf
末尾添加
# Static IP configuration
interface eth0
static ip_address=192.168.1.200
static routers=192.168.1.1
static domain_name_servers=255.255.255.0
interface wlan0
static ip_address=192.168.1.200
static routers=192.168.1.1
static domain_name_servers=255.255.255.0
重新启动即可(reboot)
192.168.1.200是固定ip