Configuring FreeRadius for AAA Cisco clients
AAA is a network protocol that define basically three functionality, Authentication, Authorization and Accounting. It’s very useful for distributed systems to need authenticate users to have access for a specific services. In this post We’ll configure FreeRadius as AAA server and configure a Cisco device to allow login connections across ssh with the radius users configured on the server.

The devices used in this scenario are:
- Cisco Router: 192.168.0.254/24
- Debian Server (FreeRadius): 192.168.0.1/24
Freeradius configuration
- Install freeradius:
- Edit clients configuration file:
- Add the new user to allow login to our router with a privilege level of 15:
- Restart freeradius:
Router configuration
- Defining new aaa login configuration:
With this configuration if the radius server fails, the device will use local users for the authentication.
- Configuring ssh and use radius to authenticate the users:
Configuring authorization and accounting
- Authorizing users to run an exec shell if the authentication is success:
- Configuring accounting for all system level events and exec shell sessions:
- Check accounting start and stop events of a login user:
Sources
http://www.cisco.com/en/US/docs/ios/security/command/reference/sec_a1.html#wp1088470
http://wiki.freeradius.org/vendor/Cisco
http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_user_guide_chapter09186a008007e364.html
The devices used in this scenario are:
- Cisco Router: 192.168.0.254/24
- Debian Server (FreeRadius): 192.168.0.1/24
Freeradius configuration
- Install freeradius:
# apt-get install freeradius |
# vi /etc/freeradius/clients.confclient 192.168.0.254 {secret = shar3k3ynastype = ciscoshortname = rcentral} |
# vi /etc/freeradius/usersadmin Cleartext-Password := "P@ssw0rd"Service-Type = NAS-Prompt-User,Cisco-AVPair = "shell:priv-lvl=15" |
# service freeradius restart |
- Defining new aaa login configuration:
rcentral#config termrcentral(config)# aaa new-modelrcentral(config)#radius-server host 192.168.0.1 auth-port 1812 acct-port 1813 key shar3k3yrcentral(config)# aaa authentication login default group radius local |
- Configuring ssh and use radius to authenticate the users:
rcentral#config termrcentral(config)# ip domain name mydomainrcentral(config)# crypto key generate rsa modulus 1024rcentral(config)# ip ssh version 2rcentral(config)# line vty 0 15rcentral(config)# transport input sshrcentral(config)# login authentication default |
- Authorizing users to run an exec shell if the authentication is success:
rcentral(config)#aaa authorization exec default if-authenticated |
rcentral(config)#aaa accounting system default start-stop group radiusrcentral(config)#aaa accounting exec default start-stop group radius |
# cat /var/log/freeradius/radacct/192.168.0.254/detail-20130107Mon Jan 7 14:25:07 2013Acct-Session-Id = "0000000A"User-Name = "admin"Acct-Authentic = RADIUSAcct-Status-Type = StartNAS-Port = 2NAS-Port-Id = "tty2"NAS-Port-Type = VirtualService-Type = NAS-Prompt-UserNAS-IP-Address = 192.168.0.254Acct-Delay-Time = 0Acct-Unique-Session-Id = "df599de6a2047d4b"Timestamp = 1357565107Request-Authenticator = VerifiedMon Jan 7 14:29:05 2013Acct-Session-Id = "0000000A"User-Name = "admin"Acct-Authentic = RADIUSAcct-Terminate-Cause = User-RequestAcct-Session-Time = 239Acct-Status-Type = StopNAS-Port = 2NAS-Port-Id = "tty2"NAS-Port-Type = VirtualService-Type = NAS-Prompt-UserNAS-IP-Address = 192.168.0.254Acct-Delay-Time = 0Acct-Unique-Session-Id = "df599de6a2047d4b"Timestamp = 1357565345Request-Authenticator = Verified |
http://www.cisco.com/en/US/docs/ios/security/command/reference/sec_a1.html#wp1088470
http://wiki.freeradius.org/vendor/Cisco
http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_user_guide_chapter09186a008007e364.html
Nhận xét
Đăng nhận xét