树莓派安装centos并配置wifi

树莓派安装centos并配置wifi

烧录centos镜像到树莓派。

1.连接centos

1.找根网线连接到树莓派
2.识别全部空间

$ /usr/bin/rootfs-expand
#默认是没有全部识别到 TF 卡的

3.验证

$ cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (AltArch)
$ uname -a
Linux home_jarbo 5.4.28-v8.1.el7 #1 SMP PREEMPT Mon Mar 30 21:28:10 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux
$ getconf LONG_BIT
64

2.配置 WiFi

1.查看网络包是否安装

$ rpm -qa | grep NetworkManager
NetworkManager-libnm-1.18.4-3.el7.aarch64
NetworkManager-team-1.18.4-3.el7.aarch64
NetworkManager-wifi-1.18.4-3.el7.aarch64
NetworkManager-1.18.4-3.el7.aarch64
NetworkManager-tui-1.18.4-3.el7.aarch64

2.设置 NetworkManager 自动启动

$ chkconfig NetworkManager on
或 systemctl enable NetworkManager 

3.安装 NetworkManager-wifi

$ yum -y install NetworkManager-wifi

4.开启 WiFi

$ nmcli r wifi on

5.测试(扫描信号)

$ nmcli dev wifi

IN-USE  SSID                    MODE   CHAN  RATE        SIGNAL  BARS  SECURITY  
        debug                   Infra  6     260 Mbit/s  100     ▂▄▆█  WPA2      
        warn                    Infra  6     260 Mbit/s  100     ▂▄▆█  WPA2      
        FBI                     Infra  44    540 Mbit/s  100     ▂▄▆█  WPA2      
        error                   Infra  44    540 Mbit/s  100     ▂▄▆█  WPA2      
        TP-LINK_1003            Infra  6     405 Mbit/s  95      ▂▄▆█  WPA1 WPA2 
        Xiaomi_FF00             Infra  1     130 Mbit/s  55      ▂▄__  WPA1 WPA2 
        TP-LINK_HyFi_53         Infra  6     405 Mbit/s  50      ▂▄__  WPA1 WPA2 
        客厅的父母乐_A8BC        Infra  1     130 Mbit/s  49      ▂▄__  WPA1      
        客厅的父母乐_B12AP       Infra  9     65 Mbit/s   45      ▂▄__  WPA2      
        xiaomi-plc-v1_miapa766  Infra  9     130 Mbit/s  40      ▂▄__  --        
        muriqionghua            Infra  8     270 Mbit/s  39      ▂▄__  WPA1 WPA2 
        --                      Infra  6     270 Mbit/s  37      ▂▄__  WPA2      
        601                     Infra  11    130 Mbit/s  30      ▂___  WPA1 WPA2 
        --                      Infra  6     270 Mbit/s  29      ▂___  WPA2      
        TP                      Infra  6     270 Mbit/s  29      ▂___  WPA2

6.连接

$ nmcli dev wifi connect SSID password <password>
$ nmcli dev wifi connect FBI password FBICOMEING123456

$ ip addr
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:c0:46:97 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.218/24 brd 10.10.10.255 scope global noprefixroute dynamic eth0
       valid_lft 85493sec preferred_lft 85493sec
    inet6 240e:338:a1c:f530:2402:8451:2767:54c5/64 scope global noprefixroute dynamic 
       valid_lft 595sec preferred_lft 595sec
    inet6 fe80::b2ba:4ab:7c3b:17a1/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:c0:46:98 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.220/24 brd 10.10.10.255 scope global noprefixroute dynamic wlan0
       valid_lft 86378sec preferred_lft 86378sec
    inet6 240e:338:a1c:f530:fd65:fd5f:8c48:58ce/64 scope global noprefixroute dynamic 
       valid_lft 596sec preferred_lft 596sec
    inet6 fe80::5144:d9cb:5ce0:fd05/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
#wlan0 就是

7.端口 WiFi

$ nmcli device disconnect wlan0
或
$ nmcli con del FBI
上一篇:php中如何实现多进程


下一篇:redirect route 路由传参