树莓派 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

发布了35 篇原创文章 · 获赞 17 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/shaopengf/article/details/52412429