树莓派 raspberry pi 的静态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.10
netmask 255.255.255.0
gateway 192.168.0.1

dns-nameservers 114.114.114.114


auto wlan0

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers x.x.x.x #你的本地dns地址

3.重启网络

sudo /etc/init.d/networking restart

你可能感兴趣的:(raspberry,pi)