LoginSignup
6
7

More than 3 years have passed since last update.

Raspberry Pi4 (Raspbian Buster)をWPA2エンタープライズのWi-Fiにつなげてみた

Last updated at Posted at 2020-03-26

はじめに

Raspberry Pi3(Raspbian Stretch)をWPA2エンタープライズに繋げる方法は多くの方が紹介されておりますが、Raspberry Pi4(Raspbian Buster)における方法を見かけなかったので備忘録として投稿します。

環境

デバイス:Raspberry Pi4 ModelB 2GB
OS:Raspbian Buster
アクセスポイント:Cisco Meraki MR33
※自前RADIUSサーバーが無いため、「Meraki Cloud Authentication」を使用。

設定その1(wpa_supplicant.confの編集)

sudo nano(またはお好きなエディタ) /etc/wpa_supplicant/wpa_supplicant.conf でファイルを編集します。

wpa_supplicant.conf編集後
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP

network={
    ssid="<接続したいSSID名>"
    proto=RSN
    key_mgmt=WPA-EAP
    pairwise=CCMP
    auth_alg=OPEN
    eap=PEAP
    identity="<接続するためのユーザー名>"
    password="<パスワード>"
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
    priority=1
}

最初の3行はデフォルトで入っていると思いますので、「network=」の行から追記します。
また、パスワードは平文で入力しています。セキュリティ面で不安な方はhash化するなどしてください。

OSがRaspbian Stretchですと、上記の様にwpa_supplicant.confを編集することでWPA2エンタープライズのWi-Fiに繋げられました。
しかしRaspberry Pi4(Raspbian Buster)で実施したところ、接続→切断→接続...を繰り返し、しまいにはDHCPで割当たるはずのIPも「169.254.xx.xx」と失敗してしまいました。
ググっていたところ、フォーラムでも同じ事象に出くわしている方がおり、記事に書かれていた対処法(後述)を実施したところうまく接続できました。

Raspbian Buster - WiFi WPA2 enterprise broken?
https://www.raspberrypi.org/forums/viewtopic.php?t=247310

設定その2(dhcpcd.confの編集)

フォーラムに記載されていた対処法になります。
sudo nano(またはお好きなエディタ) /etc/dhcpcd.conf でファイルを編集します。

dhcpcd.conf編集後
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

~中略~

interface eth0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
static domain_search=
noipv6

interface wlan0
env ifwireless=1
env wpa_supplicant_driver=wext,nl80211

末尾3行の部分を追記してください。
家の環境では有線NICのアドレスを固定で使用していますので、eth0の設定情報も書かれています。

wlan0部分を追記した後、Raspberry Piの再起動をしたところ自動的にWPA2エンタープライズのWi-Fiにつながるようになりました:relaxed:

参考

以前、Raspberry Pi ZeroをWPA2エンタープライズのWi-Fiにつなげた際に参考にさせていただいた記事です。今回のRaspberry Pi4でも同様の方法となります。
Raspberry Pi3でWPA2-EAP(PEAP)なWi-Fiに接続する
https://qiita.com/YasuhiroABE/items/1c8ac9e5636b28565c4b

家のMerakiでWPA2エンタープライズのWi-Fi環境を作った際は以下のサイトを参考にしました。
Configuring WPA2-Enterprise with Meraki Authentication
https://documentation.meraki.com/MR/Encryption_and_Authentication/Configuring__WPA2-Enterprise_with_Meraki_Authentication

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7