树莓派命令行配置无线网络
2020-05-29 16:04:20来源:博客园 阅读 ()
树莓派命令行配置无线网络
树莓派版本: Raspberry Pi 4B
操作系统 : Ubuntu Server 20.04_x64
使用 ip a 查看无线网卡名称:
ubuntu@ubuntu:~$ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether dc:a6:32:6b:bd:cf brd ff:ff:ff:ff:ff:ff inet 192.168.1.147/24 brd 192.168.1.255 scope global dynamic eth0 valid_lft 603225sec preferred_lft 603225sec inet6 fe80::dea6:32ff:fe6b:bdcf/64 scope link valid_lft forever preferred_lft forever 3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether dc:a6:32:6b:bd:d0 brd ff:ff:ff:ff:ff:ff ubuntu@ubuntu:~$
eth0是有线网卡,wlan0是无线网卡,接下来改/etc/netplan/下的YAML配置文件,不同的机器文件名不一样 :
ubuntu@ubuntu:~$ ls /etc/netplan/ 50-cloud-init.yaml ubuntu@ubuntu:~$ cat /etc/netplan/50-cloud-init.yaml # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: ethernets: eth0: dhcp4: true optional: true version: 2 ubuntu@ubuntu:~$
修改后的内容:
ubuntu@ubuntu:~$ cat /etc/netplan/50-cloud-init.yaml # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: ethernets: eth0: dhcp4: true optional: true version: 2 wifis: wlan0: dhcp4: true access-points: "wifi的ssid": password: "wifi密码" ubuntu@ubuntu:~$
配置生效:
ubuntu@ubuntu:~$ sudo netplan try ubuntu@ubuntu:~$ sudo netplan apply
本文github地址:
https://github.com/mike-zhang/mikeBlogEssays/blob/master/2020/20200529_树莓派命令行配置无线网络.rst
欢迎补充
原文链接:https://www.cnblogs.com/MikeZhang/p/raspi-ubuntu-set-wlan-20200529.html
如有疑问请与原作者联系
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
上一篇:服务器开发 Ubuntu
- 树莓派4 (8GB) RaspiOS 64 bit 入手配置流程 2020-06-10 2020-06-11
- windows10安装配置WSL(Ubuntu) 2020-06-07
- 树莓派镜像制作(图文) 2020-06-06
- 树莓派使用 OLED 屏显示图片及文字 2020-06-05
- 简单安装配置samba服务器 2020-06-03
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash