树莓派设置静态固定IP

 

1.输入命令

sudo nano /etc/network/interfaces

2.打开后是这样:

auto lo
iface lo inet loopback
iface eth0 inet dhcp.

auto wlan0
iface wlan0 inet dhcp

配置静态ip改为

auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.114
netmask 255.255.255.0
gateway 192.168.1.1

auto wlan0
iface wlan0 inet static
address 192.168.1.114
netmask 255.255.255.0
gateway 192.168.1.1
wpa-ssid 你的wifi名称
wpa-passphrase 你的wifi密码
wireless-channel 11

3.重启网络

sudo /etc/init.d/networking restart

 

posted @ 2018-07-14 16:52  梁小灶  阅读(2517)  评论(0编辑  收藏  举报