Ubuntu22.04配置WiFi
注意:在/etc/netplan/
下的配置文件,格式一定要正确,否则用sudo netplan try
的时候会报错
一、查看无线网卡的名称
//choice-1
ls /sys/class/net
//choice-2
ip a
//choice-3
ifconfig -a
二、修改配置文件
文件路径:/etc/netplan/*.yaml
![外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传](https://img-home.csdnimg.cn/images/20230724024159.png?origin_
14094510-bizhci5.png&pos_id=img-heNm9iHl-1694656303548)
修改前备份:sudo cp *.yaml *.yaml.bak
修改:sudo vim *.yaml
配置格式:
network:
version: 2
ethernets:
eth0:
dhcp4: true
optional: true
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
"ZhaoLan":
password: "zlkj2003"
示例:
network:
ethernets:
eth0:
dhcp4: true
optional: true
version: 2
wifis:
wlp3s0:
optional: true
access-points:
"SSID-NAME-HERE":
password: "PASSWORD-HERE"
dhcp4: true
三、应用配置
sudo netplan apply