Up Wi-Fi 接続する 作成: 2021-02-25
更新: 2021-02-25


    設定の反映 ( =設定内容で起動)
    $ sudo netplan --debug apply

    接続されていることのチェック:
    $ 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 fq_codel state UP group default qlen 1000 link/ether b8:27:eb:49:40:35 brd ff:ff:ff:ff:ff:ff inet 192.168.1.150/24 brd 192.168.1.255 scope global eth0 valid_lft forever preferred_lft forever inet 192.168.1.20/24 brd 192.168.1.255 scope global secondary dynamic eth0 valid_lft 13789sec preferred_lft 13789sec inet6 2400:4060:e62:a700:ba27:ebff:fe49:4035/64 scope global dynamic mngtmpaddr noprefixroute valid_lft 14210sec preferred_lft 14210sec inet6 fe80::ba27:ebff:fe49:4035/64 scope link valid_lft forever preferred_lft forever 3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether b8:27:eb:1c:15:60 brd ff:ff:ff:ff:ff:ff inet 192.168.1.150/24 brd 192.168.1.255 scope global wlan0 valid_lft forever preferred_lft forever inet6 fe80::ba27:ebff:fe1c:1560/64 scope link valid_lft forever preferred_lft forever
    Wi-Fi 接続されている Raspberry Pi と ssh接続
    1. ネットケーブルを外す
    2. PCで,ターミナルの新規ウィンドウを開き,ssh 接続
        $ ssh ubuntu@192.168.1.150


    $ sudo netplan --debug apply ** (generate:25969): DEBUG: 16:33:06.008: Processing input file /etc/netplan/50-cloud-init.yaml.. ** (generate:25969): DEBUG: 16:33:06.009: starting new processing pass ** (generate:25969): DEBUG: 16:33:06.009: wlan0: adding wifi AP 'pr500k-5a60e2-1' ** (generate:25969): DEBUG: 16:33:06.009: wlan0: adding wifi AP 'pr500k-5a60e2-2' ** (generate:25969): DEBUG: 16:33:06.009: We have some netdefs, pass them through a final round of validation ** (generate:25969): DEBUG: 16:33:06.009: wlan0: setting default backend to 1 ** (generate:25969): DEBUG: 16:33:06.009: Configuration is valid ** (generate:25969): DEBUG: 16:33:06.010: eth0: setting default backend to 1 ** (generate:25969): DEBUG: 16:33:06.010: Configuration is valid ** (generate:25969): DEBUG: 16:33:06.011: Generating output files.. ** (generate:25969): DEBUG: 16:33:06.012: openvswitch: definition eth0 is not for us (backend 1) ** (generate:25969): DEBUG: 16:33:06.012: NetworkManager: definition eth0 is not for us (backend 1) ** (generate:25969): DEBUG: 16:33:06.012: Creating wpa_supplicant config ** (generate:25969): DEBUG: 16:33:06.012: wlan0: Creating wpa_supplicant configuration file run/netplan/wpa-wlan0.conf ** (generate:25969): DEBUG: 16:33:06.012: Creating wpa_supplicant unit /run/systemd/system/netplan-wpa-wlan0.service (generate:25969): GLib-DEBUG: 16:33:06.012: posix_spawn avoided (workdir specified) (fd close requested) ** (generate:25969): DEBUG: 16:33:06.032: Creating wpa_supplicant service enablement link /run/systemd/system/systemd-networkd.service.wants/netplan-wpa-wlan0.service ** (generate:25969): DEBUG: 16:33:06.032: openvswitch: definition wlan0 is not for us (backend 1) ** (generate:25969): DEBUG: 16:33:06.032: NetworkManager: definition wlan0 is not for us (backend 1) (generate:25969): GLib-DEBUG: 16:33:06.033: posix_spawn avoided (fd close requested) (generate:25969): GLib-DEBUG: 16:33:06.035: posix_spawn avoided (fd close requested) DEBUG:netplan generated networkd configuration changed, restarting networkd DEBUG:eth0 not found in {} DEBUG:wlan0 not found in {} DEBUG:Merged config: network: ethernets: eth0: addresses: - 192.168.1.150/24 dhcp4: true gateway4: 192.168.1.1 nameservers: addresses: - 192.168.1.1 - 8.8.8.8 search: [] optional: true renderer: networkd version: 2 wifis: wlan0: access-points: pr500k-5a60e2-1: password: d69d7cefed9b2 pr500k-5a60e2-2: password: a724708d8fa58 addresses: - 192.168.1.150/24 dhcp4: true gateway4: 192.168.11.1 nameservers: addresses: - 192.168.1.1 - 8.8.8.8 optional: true DEBUG:no netplan generated NM configuration exists DEBUG:eth0 not found in {} DEBUG:wlan0 not found in {} DEBUG:Merged config: network: ethernets: eth0: addresses: - 192.168.1.150/24 dhcp4: true gateway4: 192.168.1.1 nameservers: addresses: - 192.168.1.1 - 8.8.8.8 search: [] optional: true renderer: networkd version: 2 wifis: wlan0: access-points: pr500k-5a60e2-1: password: d69d7cefed9b2 pr500k-5a60e2-2: password: a724708d8fa58 addresses: - 192.168.1.150/24 dhcp4: true gateway4: 192.168.11.1 nameservers: addresses: - 192.168.1.1 - 8.8.8.8 optional: true DEBUG:Link changes: {} DEBUG:netplan triggering .link rules for lo DEBUG:netplan triggering .link rules for eth0 DEBUG:netplan triggering .link rules for wlan0 DEBUG:eth0 not found in {} DEBUG:wlan0 not found in {} DEBUG:Merged config: network: ethernets: eth0: addresses: - 192.168.1.150/24 dhcp4: true gateway4: 192.168.1.1 nameservers: addresses: - 192.168.1.1 - 8.8.8.8 search: [] optional: true renderer: networkd version: 2 wifis: wlan0: access-points: pr500k-5a60e2-1: password: d69d7cefed9b2 pr500k-5a60e2-2: password: a724708d8fa58 addresses: - 192.168.1.150/24 dhcp4: true gateway4: 192.168.11.1 nameservers: addresses: - 192.168.1.1 - 8.8.8.8 optional: true