Tuesday 30 September 2014

Configure 802.1X Auth Mechanism using CLI in Linux

 
Connecting to a LAN network that uses 802.1x and EAPOL using the command line interface.

First, you would need to setup a wpa_supplicant.conf config file as shown below.

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=users
ap_scan=0
fast_reauth=1
network={
    key_mgmt=IEEE8021X
    eap=PEAP
    phase2="auth=MSCHAPV2"
    identity="IDENTITY"
    password="PASSWORD"
}

And that's pretty much it! All you need to do now is run this command:
 
wpa_supplicant -D wired -i eth0 -dd -c /path/to/config/file  #Replace eth0 with your ethernet interface

This could take a few seconds to run but should end with an authentication successful message, if not, try to find the place where it fails and try to debug it.

Once this is ready, you need to request for an ip address, run the following command.
 
dhclient eth0
And you're done!

1 comment:

  1. Brilliant. This man deserves a medal, and then another one.

    ReplyDelete