英語php
下載html
打印mysql
已更新: 2017 年 5 月 23 日sql
文檔 ID:211263數據庫
關於翻譯apache
簡介vim
配置安全
本文解釋如何設置一WLAN (無線局域網)與802.1x安全和PEAP (已保護可擴展的認證協議)做爲EAP (可擴展的認證協議)。FreeRADIUS使用做爲外部遠程驗證撥入用戶服務(RADIUS)服務器。
思科建議您有基礎知識Linux,精力編輯器和AireOS無線局域網控制器(WLCs)。
注意: 本文打算提供讀者在PEAP-MS-CHAPv2驗證的一個freeRADIUS服務器要求的配置的一示例。在本文提交的freeRADIUS服務器配置在實驗室裏測試了而且被發現工做正如所料。Cisco技術支持中心(TAC)不支持freeRADIUS服務器配置。
使用的組件
CentOS7或Red帽子恩×××賴斯Linux 7 (RHEL7) (推薦的1 GB RAM和至少20 GB HDD)
WLC 5508個v8.3
MariaDB (MySQL)
FreeRADIUS
PHP 7
本文檔中的信息都是基於特定實驗室環境中的設備編寫的。本文檔中使用的全部設備最初均採用原始(默認)配置。若是您使用的是真實網絡,請確保您已經瞭解全部命令的潛在影響。
網絡圖
步驟1.運行這些命令安裝httpd服務器和MariaDB。
[root@tac-mxwireless ~]# yum -y update [root@tac-mxwireless ~]# yum -y groupinstall "Development Tools" [root@tac-mxwireless ~]# yum -y install httpd httpd-devel mariadb-server mariadb
步驟2.啓動而且啓用httpd (Apache)和MariaDB服務器。
[root@tac-mxwireless ~]# systemctl enable httpd [root@tac-mxwireless ~]# systemctl start httpd [root@tac-mxwireless ~]# systemctl start mariadb [root@tac-mxwireless ~]# systemctl enable mariadb
步驟3.配置最初的MariaDB設置獲取它。
[root@tac-mxwireless ~]# NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!
步驟4.配置freeRADIUS的數據庫(請使用配置的一樣密碼在步驟3)。
[root@tac-mxwireless ~]# mysql -u root -p -e "CREATE DATABASE radius" [root@tac-mxwireless ~]# mysql -u root -p -e "show databases" [root@tac-mxwireless ~]# mysql -u root -p MariaDB [(none)]> GRANT ALL ON radius.* TO radius@localhost IDENTIFIED BY "radiuspassword"; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> \q Bye
步驟1.運行這些命令安裝在CentOS7的PHP 7。
[root@tac-mxwireless ~]# cd ~ [root@tac-mxwireless ~]# curl '' -o setup-ius.sh [root@tac-mxwireless ~]# sudo bash setup-ius.sh [root@tac-mxwireless ~]# sudo yum remove php-cli mod_php php-common [root@tac-mxwireless ~]# sudo yum -y install mod_php70u php70u-cli php70u-mysqlnd php70u-devel php70u-gd php70u-mcrypt php70u-mbstring php70u-xml php70u-pear [root@tac-mxwireless ~]# sudo apachectl restart
步驟1.運行此命令安裝FreeRADIUS。
[root@tac-mxwireless ~]# yum -y install freeradius freeradius-utils freeradius-mysql freeradius-sqlite
第二步:在mariadb.service之後作radius.servicestart。
運行此指令:
[root@tac-mxwireless ~]# vim /etc/systemd/system/multi-user.target.wants/radiusd.service
添加在[Unit]
部分的一條線路:
After=mariadb.service
[Unit]部分必須以下所示:
[Unit] Description=FreeRADIUS high performance RADIUS server. After=syslog.target network.target After=mariadb.service
步驟3.開始的啓動和enable (event) freeradius在啓動。
[root@tac-mxwireless ~]# systemctl start radiusd.service [root@tac-mxwireless ~]# systemctl enable radiusd.service
步驟4.安全的Enable (event) firewalld。
[root@tac-mxwireless ~]# systemctl enable firewalld [root@tac-mxwireless ~]# systemctl start firewalld [root@tac-mxwireless ~]# systemctl status firewalld
步驟5.增長永久性規則到默認區域容許http、https和RADIUS服務。
[root@tac-mxwireless ~]# firewall-cmd --get-services | egrep 'http|https|radius' [root@tac-mxwireless ~]# firewall-cmd --add-service={http,https,radius} --permanent success
步驟6.更改的從新加載firewalld能生效。
[root@tac-mxwireless ~]# firewall-cmd --reload
爲了配置FreeRADIUS使用MariaDB,請聽從這些步驟。
步驟1.導入RADIUSdatabase方案填充RADIUS數據庫。
[root@tac-mxwireless ~]# mysql -u root -p radius < /etc/raddb/mods-config/sql/main/mysql/schema.sql
步驟2.建立SQL的一條軟鏈在/etc/raddb/mods-enabled下
[root@tac-mxwireless ~]# ln -s /etc/raddb/mods-available/sql /etc/raddb/mods-enabled/
步驟3.配置SQL模塊/raddb/mods-available/sql而且更改數據庫鏈接參數到套件您的環境。
[root@tac-mxwireless ~]# vim /etc/raddb/mods-available/sql
SQL部分必定看起來相似於下面。
sql { driver = "rlm_sql_mysql" dialect = "mysql" # Connection info: server = "localhost" port = 3306 login = "radius" password = "radpass" # Database table configuration for everything except Oracle radius_db = "radius" } # Set to ‘yes’ to read radius clients from the database (‘nas’ table) # Clients will ONLY be read on server startup. read_clients = yes # Table to keep radius client info client_table = 「nas」
步驟4.崔凡吉萊/etc/raddb/mods-enabled/sql組對radiusd的。
[root@tac-mxwireless ~]# chgrp -h radiusd /etc/raddb/mods-enabled/sql
步驟1.編輯/etc/raddb/clients.conf爲了設置WLC的共享密鑰。
[root@tac-mxwireless ~]# vim /etc/raddb/clients.conf
第二步:在底部請添加您的控制器IP地址和共享密鑰。
client <WLC-ip-address> { secret = <shared-key> shortname = <WLC-name>}
GUI :
步驟1.打開WLC的GUI而且導航對SECURITY>RADIUS >驗證>New。
步驟2.填裝RADIUS服務器信息。
CLI :
> config radius auth add <index> <radius-ip-address> 1812 ascii <shared-key> > config radius auth disable <index> > config radius auth retransmit-timeout <index> <timeout-seconds> > config radius auth enable <index>
GUI :
步驟1.打開WLC的GUI而且導航對WLAN >建立新>去。
步驟2.選擇一名稱對於SSID和配置文件,而後單擊應用。
CLI :
> config wlan create <id> <profile-name> <ssid-name>
步驟3.分配RADIUS服務器到WLAN。
CLI :
> config wlan radius_server auth add <wlan-id> <radius-index>
GUI :
導航到安全>AAA服務器而且選擇但願的RADIUS服務器,而後命中數應用。
步驟4.隨意地請增長會話超時
CLI :
> config wlan session-timeout <wlan-id> <session-timeout-seconds>
GUI :
步驟5.啓用WLAN
CLI :
> config wlan enable <wlan-id>
GUI :
默認狀況下客戶端使用PEAP協議,然而freeRadius支持其餘方法(沒報道在此指南)。
步驟1.編輯文件/etc/raddb/users。
[root@tac-mxwireless ~]# nano /etc/raddb/users
第二步:在文件的底部請添附用戶信息。在本例中user1是用戶名和Cisco123密碼。
user1 Cleartext-Password := "Cisco123"
步驟3.從新啓動FreeRadius。
[root@tac-mxwireless ~]# systemctl restart radiusd.service
FreeRADIUS附有在路徑/etc/raddb/certs存儲的默認CA (證實Authoritiy)證書和設備證書。 這些證書名稱是ca.pem和server.pem server.pemis客戶端將接收的證書,當他們經過認證過程時。若是須要分配EAP驗證的一不一樣的身份驗證您能刪除他們,而且保存新的在有那的同一個路徑請苛求一樣名稱。
配置筆記本電腦Windows機器鏈接到與802.1x驗證和PEAP/MS-CHAP (質詢握手驗證協議的Microsoft版本)版本2的一SSID。
要建立在那裏Windows機器的WLAN配置文件請是兩個選項:
安裝在計算機的自簽名證書驗證和委託freeRADIUS服務器爲了完成驗證
繞過RADIUS服務器的驗證而且委託用於的全部RADIUS服務器執行驗證(沒推薦,能變爲安全問題)。這些選項的配置在終端設備配置解釋-請建立WLAN配置文件-步驟xx。
若是使用在freeRADIUS安裝的默認證書,請聽從這些步驟爲了導入從freeRADIUS服務器的EAP證書到終端設備。
步驟1.從FreeRadius得到cert :
[root@tac-mxwireless ~]# cat /etc/raddb/certs/ca.pem -----BEGIN CERTIFICATE----- MIIE4TCCA8mgAwIBAgIJAKLmHn4eZLjBMA0GCSqGSIb3DQEBBQUAMIGTMQswCQYD VQQGEwJGUjEPMA0GA1UECBMGUmFkaXVzMRIwEAYDVQQHEwlTb21ld2hlcmUxFTAT BgNVBAoTDEV4YW1wbGUgSW5jLjEgMB4GCSqGSIb3DQEJARYRYWRtaW5AZXhhbXBs ZS5jb20xJjAkBgNVBAMTHUV4YW1wbGUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4X DTE3MDMzMTExMTIxNloXDTE3MDUzMDExMTIxNlowgZMxCzAJBgNVBAYTAkZSMQ8w DQYDVQQIEwZSYWRpdXMxEjAQBgNVBAcTCVNvbWV3aGVyZTEVMBMGA1UEChMMRXhh bXBsZSBJbmMuMSAwHgYJKoZIhvcNAQkBFhFhZG1pbkBleGFtcGxlLmNvbTEmMCQG A1UEAxMdRXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQC0vJ53NN7J9vhpKhcB3B0OXLpeQFWjqolQOB9F /8Lh2Hax2rzb9wxOi1MOyXR+kN22H7RNwUHET8VdyGUsA4OdZWuyzI8sKi5H42GU Eu6GDw1YJvhHn4rVC36OZU/Nbaxj0eR8ZG0JGse4ftQKLfckkvCOS5QGn4X1elRS oFe27HRF+pTDHd+nzbaDvhYWvFoe6iA27Od7AY/sDuo/tiIJWGdm9ocPz3+0IiFC ay6dtG55YQOHxKaswH7/HJkLsKWhS4YmXLgJXCeeJqooqr+TEwyCDEaFaiX835Jp gwNNZ7X5US0FcjuuOtpJJ3hfQ8K6uXjEWPOkDE0DAnqp4/n9AgMBAAGjggE0MIIB MDAdBgNVHQ4EFgQUysFNRZKpAlcFCEgwdOPVGV0waLEwgcgGA1UdIwSBwDCBvYAU ysFNRZKpAlcFCEgwdOPVGV0waLGhgZmkgZYwgZMxCzAJBgNVBAYTAkZSMQ8wDQYD VQQIEwZSYWRpdXMxEjAQBgNVBAcTCVNvbWV3aGVyZTEVMBMGA1UEChMMRXhhbXBs ZSBJbmMuMSAwHgYJKoZIhvcNAQkBFhFhZG1pbkBleGFtcGxlLmNvbTEmMCQGA1UE AxMdRXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCCQCi5h5+HmS4wTAMBgNV HRMEBTADAQH/MDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly93d3cuZXhhbXBsZS5j b20vZXhhbXBsZV9jYS5jcmwwDQYJKoZIhvcNAQEFBQADggEBACsPR2jiOFXnTsK4 1wnrrMylZZb12gDuqK+zKELox2mzlDMMK83tBsL8yjkv70KeZn821IzfTrTfvhzV mjX6HgaWfYyMjYYYSw/iEu2JsAtQdpvC3di10nGwVPHlzbozPdov8cZtCb21ynfY Z6cNjx8+aYQIcsRIyqA1IXMOBwIXo141TOmoODdgfX95lpoLwgktRLkvl7Y7owsz ChYDO++H7Iewsxx5pQfm56dA2cNrlTwWtMvViKyX7GlpwlbBOxgkLiFJ5+GFbfLh a0HBHZWhTKvffbr62mkbfjCUfJU4T3xgY9zFwiwT+BetCJgAGy8CT/qmnO+NJERO RUvDhfE= -----END CERTIFICATE-----
步驟2.複製和插入上一步的輸出到文本文件而且更改分機對.crt
步驟3.雙擊文件而且選擇安裝證書…
步驟4.安裝證書到可靠的根證書頒發機構存儲。
步驟1.在Start圖標的右鍵單擊和選擇控制面板。
步驟2.導航到網絡和互聯網,那之後導航對中心的網絡和共享而且單擊創建了新鏈接或網絡。
步驟3.選擇手工鏈接對無線網絡而且其次單擊。
步驟4.輸入與SSID和安全類型WPA2-Enterprise的名稱的信息而且其次單擊。
步驟5.選擇崔凡吉萊鏈接設置爲了定製WLAN配置文件的配置。
步驟6.導航對安全選項卡而且點擊設置。
步驟7.,若是RADIUS服務器驗證,請選擇。
若是是, enable (event)驗證服務器的標識經過驗證證書和從可靠的根證書頒發機構:列出精選freeRADIUS自簽名證書。
之後該請選擇自動地配置而且禁用使用個人Windows登陸名字和密碼…,而後點擊OK鍵
步驟8.配置用戶憑證。
一旦回到安全選項卡,請選擇在freeRADIUS配置爲了驗證用戶的先進的設置,指定認證模式做爲用戶認證而且保存憑證。
運行下命令爲了監控一個特定用戶的認證過程:
> debug client <mac-add-client> > debug dot1x event enable > debug dot1x aaa enable
爲了使閱讀的簡單的方法調試客戶端輸出,請使用無線調試分析器工具:
本文轉載自: https://www.cisco.com/c/zh_cn/support/docs/wireless-mobility/wireless-lan-wlan/211263-Configure-802-1x-PEAP-with-FreeRadius.html