树莓派网络配置

Wi-Fi 命令

$ sudo iw wlan0 scan | grep SSID
$ iw wlan0 link
$ 
$ sudo reboot
$
$ sudo raspi-config

连接 Wi-Fi 使用静态 IP 地址

$ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
network={
    ssid="qige"
    psk="WX666666"
}
$ 
$ sudo vi /etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.1.5/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8
$ 
$ sudo reboot

指定默认配置

当 DHCP 不可用时,回滚到默认配置(未验证:https://wiki.archlinux.org/index.php/Dhcpcd)

$ sudo vi /etc/dhcpcd.conf
...
profile static_eth0
static ip_address=192.168.1.5/24
static routeers=192.168.1.1
static domain_name_servers=192.168.1.1

interface eth0
fallback static_eth0
...
$

results matching ""

    No results matching ""