![Raspberry Pi 用 Ubuntu Server 18.04.5 の Netplan 構成に関する問題](https://rvso.com/image/928535/Raspberry%20Pi%20%E7%94%A8%20Ubuntu%20Server%2018.04.5%20%E3%81%AE%20Netplan%20%E6%A7%8B%E6%88%90%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E5%95%8F%E9%A1%8C.png)
そこで、ロボットプロジェクトのためにRaspberry PiとUbuntuをセットアップしたい。このガイド。
書かれているように、/etc/netplan/50-cloud-init.yaml を次のように変更します。
network:
version: 2
renderer: networkd
# Renderer can be 'networkd' or 'NetworkManager'
ethernets:
eth0:
optional: true
dhcp4: false
wifis:
wlan0:
optional: true
dhcp4: true
access-points:
"YOUR-SSID-NAME":
password: "YOUR-PASSWORD"
# uncomment the line below if you're using a Microsoft DHCP Server
#dhcp-identifier: mac
注: macOS システムを使用しているため、最後の行のコメントを解除しませんでしたが、それが正しいかどうかはわかりません。
問題は:
次のように入力すると:
sudo netplan --debug try
sudo netplan --debug generate
「不明なキーワード「wlan0」」が表示されます。
エラーを Google で検索してみましたが、Web ではさまざまな種類のエラーしか見つかりません。どなたか助けていただければ幸いです。
答え1
.yaml ファイルのフォーマットが適切ではありません...
次のようになります...インデント、間隔は同じで、タブはありません。
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
wifis:
wlan0:
dhcp4: true
access-points:
"YOUR-SSID-NAME":
password: "YOUR-PASSWORD"
sudo netplan generate
sudo netplan apply
reboot
wpasupplicant もインストールする必要があります...
sudo apt-get update
sudo apt-get install wpasupplicant
reboot
.yaml が上書きされ続ける場合は...
また、次の内容で /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg を作成する必要がある場合もあります。
network: {config: disabled}