|
小天线的走起STA模式手动连接WIFI热点
- root@myir-yg2lx:~# ifconfig wlan0
- wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500 metric 1
- ether 68:4e:05:b3:ff:f2 txqueuelen 1000 (Ethernet)
- RX packets 0 bytes 0 (0.0 B)
- RX errors 0 dropped 0 overruns 0 frame 0
- TX packets 0 bytes 0 (0.0 B)
- TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
复制代码
- wpa_passphrase设置wifi名字和密码
- 关掉 并初始化wpa_supplicant 进程
使能开机自动连wlan - root@myir-yg2lx:~# systemctl enable wpa_supplicant@wlan0.service
- Created symlink /etc/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service → /lib/systemd/system/wpa_supplicant@.service.
复制代码
开机wifi自动获取到IP - root@myir-yg2lx:~# vi /etc/systemd/network/11-wlan0.network
- root@myir-yg2lx:~# cat /etc/systemd/network/11-wlan0.network
- [Match]
- Name=wlan0
- [Network]
- DHCP=yes
- [DHCP]
- RouteMetric=20
复制代码
|
|