Monday, September 14, 2020

Connect a Raspberry Pi to a wpa enterprise network

Configure a WiFi network protected with WPA2 in Raspberry Pi is as simple as running the configuration tool raspi-config in Raspberry Pi OS, but the thinks are different when you try to configure a WPA Enterprise WiFi Network.

First, you need to run the automatic raspi-conf tool to generate the file /etc/wpa_supplicant/wpa_supplicant.conf. You can use dummy info in this steep. After you will have a file with the following content.


ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=[Contry code]
network={
ssid="[SSID configurated with raspi-config]"
        psk ="[Password configurated with raspi-config]"
}

Second, change the content of the file as follow:


ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=[Contry code]
network={
ssid="[SSID configurated with raspi-config]"
key_mgmt=WPA-EAP
        eap=PEAP
        identity="[User name]"
        password="[password]"
phase2="MSCHAPV2"
}

Third, It is probably that this configuration could be all to connect to the WiFi network, but if your Rasberry Pi, don't negotiate a DHCP configuration, you need to include the following lines at the end of /etc/dhcpcd.conf

interface wlan0
env ifwireless=1
env wpa_supplicant_driver=wext


This last step avoid include a file into /etc/network/interfaces.d/ and avoid the conflict between interfaces and dhcpcd, and leave dhcpcd (pre configurated in Rasberry Pi OS), manage the interface configuration.  








No comments:

Post a Comment

A Raspberry Pi firewall: Package filter - 05 Understanding the whats and whys to manage a service

  To recap. Until now we create:  Some rules in our chains INPUT and OUTPUT to allow some traffic to specific ports A backup of our rules an...