Leif160519的blog Leif160519的blog

——————

目录
树莓派设置固定ip地址
/  

树莓派设置固定ip地址

1.编辑/etc/network/interfaces文件

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd

# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
address 192.168.10.100
gateway 192.168.10.254
netmask 255.255.255.0
nameserver 8.8.8.8

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual

    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface wlan0 inet static
    address 192.168.133.88
    netmask 255.255.255.0
    gateway 192.168.133.254
    dns-nameservers 192.168.1.254
    wpa-ssid "your_wifi"
    wpa-psk "wifi_password"

#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

  
allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

2.重启无线设置

sudo /etc/init.d/networking restart

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题树莓派设置固定ip地址
作  者Leif160519
出  处https://github.icu/articles/2019/08/27/1566886428189.html
关于博主:坐标六朝古都南京,服务器运维工程师+桌面运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!