资讯

展开

树莓派设置Wifi-以及-固定IP

作者:快盘下载 人气:46

设置WIFI

查看网卡  

 ip link show

 设置wifi

# 进入文件夹查看文件
cd /etc/netplan/
# 修改文件
sudo vim xxx.yaml
# 大致如下
network:
version: 2
ethernets:
eth0:
optional: true
dhcp4: true
# add wifi setup information here ...
wifis:
wlan0:
optional: true
access-points:
;YOUR-SSID-NAME;:
password: ;YOUR-NETWORK-PASSWORD;
dhcp4: true

检查网络

# 测试网络配置
sudo netplan --debug try
# 如果异常;查看更多问题信息
sudo netplan --debug generate
# 应用配置
sudo netplan --debug apply

 

设置固定IP

# 编辑文件
nano /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source /etc/network/interfaces.d/*
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.8 # IP地址
netmask 255.255.255.0 # 掩码
gateway 192.168.1.1 # 网关

加载全部内容

相关教程
猜你喜欢
用户评论
快盘暂不提供评论功能!