修改/etc/network/interfaces文件
sudo nano /etc/network/interfaces
打开后原文件为
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
修改为
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.110
netmask 255.255.255.0
gateway 192.168.1.1
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
其中 192.168.1.110是留给香蕉派的固定ip地址
255.255.255.0 是子网掩码
192.168.1.1 是路由器网关
搞定……