Authentication server (Freeradius)
# apt-get install freeradius openssl
# mkdir /etc/ssl/CA
# mkdir /etc/ssl/newcerts
# echo '01' > /etc/ssl/CA/serial
# touch /etc/ssl/CA/index.txt
# cat /etc/ssl/openssl.cnf
# cd /etc/ssl/CA
# openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
# mv cakey.pem /etc/ssl/private/.
# mv cacert.pem /etc/ssl/certs/.
# cat >> /etc/ssl/CA/xpextensions << eof
> [xpclient_ext]
> extendedKeyUsage=1.3.6.1.5.5.7.3.2
>
> [xpserver_ext]
> extendedKeyUsage=1.3.6.1.5.5.7.3.1
> eof
# openssl req -new -nodes -keyout freeradiuskey.pem -out freeradius.csr -days 3650
# openssl ca -in freeradius.csr -config /etc/ssl/openssl.cnf
# cp /etc/ssl/newcerts/01.pem freeradius.pem
# cat freeradiuskey.pem > freeradiuskeycert.pem
# grep -A 100 BEGIN freeradius.pem >> freeradiuskeycert.pem
# openssl req -new -nodes -keyout wxpkey.pem -out wxp.csr -days 3650
# openssl ca -in wxp.csr -config /etc/ssl/openssl.cnf -extensions xpclient_ext -extfile /etc/ssl/CA/xpextensions
# cp /etc/ssl/newcerts/02.pem wxp.pem
# openssl pkcs12 -export -in wxp.pem -inkey wxpkey.pem -certfile /etc/ssl/certs/cacert.pem -name "Wired-dot1x" -out wxp.p12
# cp /etc/ssl/certs/cacert.pem /etc/freeradius/certs/.
# cp /etc/ssl/CA/freeradiuskeycert.pem /etc/freeradius/certs/.
# cp /etc/freeradius/eap.conf /etc/freeradius/eap.conf.orig
# cat /etc/freeradius/eap.conf
# /etc/init.d/freeradius stop
# freeradius -X
Authenticator/NAS (Cisco Catalyst 2960)
Switch(config)# aaa new-model
Switch(config)# radius server freeradius
Switch(config-radius-server)# address ipv4 192.168.0.100 auth-port 1812 acct-port 1813
Switch(config-radius-server)# key MYSECRET
Switch(config)# aaa authentication dot1x default group radius
Switch(config)# aaa authorization network default group radius
Switch(config)# aaa accounting dot1x default start-stop group radius
Switch(config)# radius-server vsa send accounting
Switch(config)# radius-server vsa send authentication
Switch(config)# interface FastEthernet0/10
Switch(config-if)# switchport mode access
Switch(config-if)# authentication event fail retry 0 action authorize vlan 30
Switch(config-if)# authentication event no-response action authorize vlan 20
Switch(config-if)# authentication port-control auto
Switch(config-if)# mab eap
Switch(config-if)# dot1x pae authenticator
Switch(config-if)# dot1x timeout tx-period 1
Switch(config-if)# spanning-tree portfast
Switch# !debug dot1x
Supplicant (Windows XP)
Copy cacert.pem and wxp.p12 to the windows xp client.
Rename cacert.pem to cacert.der.
C:\> net start "Wired Autoconfig"
C:\> mmc
File > Add/Remove Snap-in... > Add > Certificates > Add > Computer account > Next > Finish > Close > OK
- Certifcates (Local Computer) > Personal > Certificates > All Tasks > Import... > wxp.p12 > key (MY_EXPORT)
- Certifcates (Local Computer) > Trusted Root Certification Authorities > Certificates > All Tasks > Import... > cacert.der
C:\> netsh lan export profile folder=C:\
C:\> type nic.xml
machineOrUser
Change 'machineOrUser' for 'machine'.
C:\> netsh lan add profile filename=nic.xml
NIC > Properties > Authentication
- Enable IEEE 802.1x authentication for this network
-- EAP type: Smart Card or other Certificate
-- Settings
--- Use a certificate on this computer > Use simple certificate selection
--- Validate server certificate
--- Trusted Root Certification Authorities > ca.lab.net
References
http://en.wikipedia.org/wiki/IEEE_802.1X
http://www.cisco.com/en/US/docs/solutions/Enterprise/Security/TrustSec_1.99/Dot1X_Deployment/Dot1x_Dep_Guide.html
No comments:
Post a Comment