K
krabs
Guest
[!] - Only for mipsel devices, like RT-N16, RT-N66U/R, RT-AC66U/R
Follow complete tutorial on the WIKI
In this tutorial we're gonna install freeradius2 (EAP-TTLS,PAP) from entware.
I still haven't tested this on the 5Ghz freq because I'm not using it, it should also work so if you are gonna using it plz report status.
We have several authentication methods to choose from like EAP-TLS,EAP-PEAP, ... I think EAP-TTLS is one of the better options and it doesn't require client certs but still uses a secure tunnel (server certificates) before inner client authentication is taking place.
Here are some more detailed descriptions:
Juniper
Wikipedia
The only disadvantage with EAP-TTLS is that there's no native support for it in Windows 7 and earlier but there's still an free third party solution for pc not sure about windows phone 8 if you cannot upgrade to 8.1.
Instead of using RSA keys, I have used elliptic curve keys and this does work extremly well on freeradius and clients.
Prerequisites: a wired device with telnet,ssh for debugging and some basic linux skills recommended.
[1] - Setup entware from Wiki
[2] - Install required packages
[3] - I have created a very stripped version of the needed config files & missing one after testing. For making things a bit easier we're gonna use that one.
[4] - Generating Certificates
Private Key & CA Cert
When generating the CA Certificate Request do not leave fields blank, we can use that as an extra check of the validity of the certificate & enter a password to protect the privatekey
Example of mine: C=BE, ST=Limburg, L=Hoeselt, O=Last-Name, OU=IT Department, CN=Certificate Authority Last-Name
Export PEM to DER (So we can import the key on Windows machines)
Export ec-cacert.pem to p12 (So we can install the certificate on android phones)
You will be asked for the private key password earlier and to create an export password. You will need the export password when installing the certificate on your phone. Replace X with a name for your certificate
Server
When generating Server Certificate Request do not enter an challenge password & optional company name
Example of mine: C=BE, ST=Limburg, L=Hoeselt, O=Last-Name, OU=IT Department, CN=Server
Encrypt Server key en generate server certificate
Move ec-server_cert.pem ec-server_key.pem to certs directory and remove new directory
Remove openssl.cnf
Generate Diffie Hellman (takes some time on router)
Move & Store CA & export dirs on a secure place. You will need a samba share or scp or winscp to copy them to your pc.
You will need ec-cacert.pem on linux as CA certificate
ec-cacert.der or p12 on windows as CA certificate
ec-cacert.p12 on android -> place it on the root of the sdcard
Now you should only have ec-server_cert.pem, ec-server_key.pem and dh in your certs directory
[5] - Edit eap.conf
Change private key pass to the password you have used to encrypt the ec-server_key.pem
Open an other terminal and go to the certs directory.
Replace this DN with the one at check_cert_issuer
[6] - Edit clients.conf (/opt/etc/freeradius2/clients.conf)
Change network range, mask at client line.
I'm assuming that the IP-address of the router = 192.168.1.1 if this is not the case change it here and also change it /opt/etc/freeradius2/sites/inner-tunnel
For the secret AP I recommended a 32 chars key, It is possible to use longer keys then 32 chars but I found that the WiFi became slower. (copy this to a text editor for later )
Use a site like this one to generate the key, do not use strange punctations, etc I'm not sure which one are allowed and which one not.
[7] - Edit users file (/opt/etc/freeradius2/users)
Change User1, etc to the name you want to use and password.
You also can add, change attributes like session-timeout to a more approriate value for you.
[8] - Let's run a test if the server initialized correctly & set max request in radiusd.conf (/opt/etc/freeradius2/radiusd.conf)
max_requests: This should be 256 multiplied by the number of clients.
If server server is listening for requests you're good to otherwise plz check error and report it here.
press ctrl-c to exit
# Start the server
[9] - Configure router wireless settings
Use the wired device now if you are not using it and login to the routers webinterface and go to the wireless page, change authentication method to WPA2 enterprise for 2.4Ghz and 5Ghz if you use that band also.
Go to the "Radius Setting" tab and change the servers IP address to the routers IP address.
Change port 1812
Enter the Secret from the clients.conf which we still have in the texteditor or open clients.conf in a telnet,ssh session to copy,pasta it.
Do the same thing for the other band if you are using it.
[10] - Now we must configure the clients.
On Windows 7,8 first import the ec-cacert.der.
Place ec-cacert.der on a USB stick or something that you could copy the cert over to the wireless clients.
Windows 8 users can skip next step.
For Windows 7 there's an old alternative called SecureW2 which was free until version 1.13. But there's even a better alternative which does works correctly with ec keys. It's eap-ttls software especially for intel wireless cards but it does also works for broadcom devices. Assuming all of you Windows 7 users also have an "intel" card here's the link EAP-TTLS driver
Now we need to create the network
Android
Follow complete tutorial on the WIKI
In this tutorial we're gonna install freeradius2 (EAP-TTLS,PAP) from entware.
I still haven't tested this on the 5Ghz freq because I'm not using it, it should also work so if you are gonna using it plz report status.
We have several authentication methods to choose from like EAP-TLS,EAP-PEAP, ... I think EAP-TTLS is one of the better options and it doesn't require client certs but still uses a secure tunnel (server certificates) before inner client authentication is taking place.
Here are some more detailed descriptions:
Juniper
Wikipedia
The only disadvantage with EAP-TTLS is that there's no native support for it in Windows 7 and earlier but there's still an free third party solution for pc not sure about windows phone 8 if you cannot upgrade to 8.1.
Instead of using RSA keys, I have used elliptic curve keys and this does work extremly well on freeradius and clients.
Prerequisites: a wired device with telnet,ssh for debugging and some basic linux skills recommended.
[1] - Setup entware from Wiki
[2] - Install required packages
Code:
opkg install freeradius2 \
freeradius2-common \
freeradius2-mod-eap \
freeradius2-mod-eap-tls \
freeradius2-mod-eap-ttls \
freeradius2-mod-files \
freeradius2-mod-pap
[3] - I have created a very stripped version of the needed config files & missing one after testing. For making things a bit easier we're gonna use that one.
Code:
cd /opt/etc/ && cp -r freeradius2 freeradius2.bak
cd freeradius2 && rm -rf *
opkg install wget
/opt/bin/wget --no-check-certificate -O - http://goo.gl/Ykov6H | tar -xzC /opt/etc/freeradius2
[4] - Generating Certificates
Code:
cd /opt/etc/freeradius2/certs
/opt/bin/wget --no-check-certificate http://goo.gl/kNg6Ms -O openssl.cnf
mkdir -p CA/private new export
Private Key & CA Cert
When generating the CA Certificate Request do not leave fields blank, we can use that as an extra check of the validity of the certificate & enter a password to protect the privatekey
Example of mine: C=BE, ST=Limburg, L=Hoeselt, O=Last-Name, OU=IT Department, CN=Certificate Authority Last-Name
Code:
openssl ecparam -name secp521r1 -genkey -noout | openssl ec -aes256 -out CA/private/ec-cakey.pem
openssl req -new -x509 -out CA/ec-cacert.pem -outform PEM -SHA512 -key CA/private/ec-cakey.pem -keyform PEM -days 3650 -extensions v3_ca -config ./openssl.cnf
Export PEM to DER (So we can import the key on Windows machines)
Code:
openssl x509 -outform DER -in CA/ec-cacert.pem -out export/ec-cacert.der
Export ec-cacert.pem to p12 (So we can install the certificate on android phones)
You will be asked for the private key password earlier and to create an export password. You will need the export password when installing the certificate on your phone. Replace X with a name for your certificate
Code:
openssl pkcs12 -export -in CA/ec-cacert.pem -inkey CA/private/ec-cakey.pem -out export/ec-cacert.p12 -name "X" -cacerts
Server
When generating Server Certificate Request do not enter an challenge password & optional company name
Example of mine: C=BE, ST=Limburg, L=Hoeselt, O=Last-Name, OU=IT Department, CN=Server
Code:
openssl req -nodes -SHA512 -newkey ec:CA/ec-cacert.pem -new -days 3650 -out new/ec-server_req.pem -keyout new/ec-server_key.pem -config ./openssl.cnf
Encrypt Server key en generate server certificate
Code:
mv new/ec-server_key.pem new/ec-server_key_temp.pem && openssl ec -in new/ec-server_key_temp.pem -aes256 -out new/ec-server_key.pem && rm -rf new/ec-server_key_temp.pem
openssl x509 -req -extfile openssl.cnf -out new/ec-server_cert.pem -SHA512 -CA CA/ec-cacert.pem -CAkey CA/private/ec-cakey.pem -in new/ec-server_req.pem -days 3650 -set_serial 0x01
Move ec-server_cert.pem ec-server_key.pem to certs directory and remove new directory
Code:
mv new/ec-server_cert.pem new/ec-server_key.pem ./ && rm -rf new
chmod 0400 ec-server_cert.pem && chmod 0400 ec-server_key.pem
Remove openssl.cnf
Code:
rm openssl.cnf
Generate Diffie Hellman (takes some time on router)
Code:
openssl dhparam -check -text -2 2048 -out dh
chmod 0600 dh
Move & Store CA & export dirs on a secure place. You will need a samba share or scp or winscp to copy them to your pc.
You will need ec-cacert.pem on linux as CA certificate
ec-cacert.der or p12 on windows as CA certificate
ec-cacert.p12 on android -> place it on the root of the sdcard
Now you should only have ec-server_cert.pem, ec-server_key.pem and dh in your certs directory
[5] - Edit eap.conf
Code:
cd /opt/etc/freeradius2 && vi eap.conf
Change private key pass to the password you have used to encrypt the ec-server_key.pem
Open an other terminal and go to the certs directory.
Code:
cd /opt/etc/freeradius2/certs
openssl x509 -noout -in ec-server_cert.pem -issuer
Replace this DN with the one at check_cert_issuer
[6] - Edit clients.conf (/opt/etc/freeradius2/clients.conf)
Change network range, mask at client line.
I'm assuming that the IP-address of the router = 192.168.1.1 if this is not the case change it here and also change it /opt/etc/freeradius2/sites/inner-tunnel
For the secret AP I recommended a 32 chars key, It is possible to use longer keys then 32 chars but I found that the WiFi became slower. (copy this to a text editor for later )
Use a site like this one to generate the key, do not use strange punctations, etc I'm not sure which one are allowed and which one not.
[7] - Edit users file (/opt/etc/freeradius2/users)
Change User1, etc to the name you want to use and password.
You also can add, change attributes like session-timeout to a more approriate value for you.
[8] - Let's run a test if the server initialized correctly & set max request in radiusd.conf (/opt/etc/freeradius2/radiusd.conf)
max_requests: This should be 256 multiplied by the number of clients.
Code:
radiusd -XX
If server server is listening for requests you're good to otherwise plz check error and report it here.
press ctrl-c to exit
# Start the server
Code:
/opt/etc/init.d/S55radiusd start
[9] - Configure router wireless settings
Use the wired device now if you are not using it and login to the routers webinterface and go to the wireless page, change authentication method to WPA2 enterprise for 2.4Ghz and 5Ghz if you use that band also.
Go to the "Radius Setting" tab and change the servers IP address to the routers IP address.
Change port 1812
Enter the Secret from the clients.conf which we still have in the texteditor or open clients.conf in a telnet,ssh session to copy,pasta it.
Do the same thing for the other band if you are using it.
[10] - Now we must configure the clients.
On Windows 7,8 first import the ec-cacert.der.
Place ec-cacert.der on a USB stick or something that you could copy the cert over to the wireless clients.
Code:
1. Open mmc as administrator -> File Add/Remove snap-in -> certificates -> add -> computer account -> local computer -> finish -> ok
2. Open certificates, Open Trusted Root Certification Authorities.
3. Right click on certificates -> all task -> import -> next -> browse to ec-cacert.der , ...
4. Close console1 do not save settings.
Windows 8 users can skip next step.
For Windows 7 there's an old alternative called SecureW2 which was free until version 1.13. But there's even a better alternative which does works correctly with ec keys. It's eap-ttls software especially for intel wireless cards but it does also works for broadcom devices. Assuming all of you Windows 7 users also have an "intel" card here's the link EAP-TTLS driver
Now we need to create the network
Code:
Go to Network and sharing server -> manage wireless networks
Add Manually create network profile -> Network name your ssid -> security type WPA-enterprise AES -> next -> change connection settings -> security tab -> (for windows 8 eap-ttls windows 7 use intel-eap-ttls) -> settings
Windows 7 select PAP
-Username
-Domain leave blank
-Password
-Roaming identiy anonymous
Check Validate Server Certificate
-Certificate Issuer (Select your certificate)
Check Specify Server or Certificate Name
-Server name must match the specified entry exactly (Your server CN)
Windows 8
[URL="http://adamsync.wordpress.com/2012/05/08/eap-ttls-on-windows-2012-build-8250/#comments"]configure eap-ttls[/URL]
Android
Code:
For android place the .p12 file on your sdcard.
On my phone 4.1.1, to install a certificate go to security -> install from storage.
You will be asked for the export password enter it if you have and install the certificate. When connecting to the network
Choose EAP-TTLS as eap-method
Choose PAP as Phase 2 verification
Identity
Password
Enable advanced options
CA certificate the one you installed
Anonymous identity just enter anonymous.
That's it you should be able to connect successfully.
Last edited by a moderator: