前面小編寫過一篇基于802.1x協定的接入認證,這是實作網絡安全性的一種常用手段,但是前提是客戶機需要通過相應的媒介(認證軟體)來實作接入認證,那麼萬一客戶并不想那麼費事,希望一切都由服務提供商來解決呢,這個當然不是問題,今天小編我就來介紹一種讓使用者省事的接入型認證,那就是基于使用者MAC位址來進行接入認證,其原理就是使用使用者的MAC位址作為使用者的使用者名和密碼,當使用者接入網絡的時候,會發送資料幀,而網絡裝置通過擷取使用者的使用者名和密碼來進行相應的認證,當然這種認證可以是網絡裝置本身負責認證工作,也可以将認證任務交給AAA伺服器來完成,小編這裡将這兩種方式都實作一下,整體的實作比較的簡單,小編這裡細細說來。
網絡裝置本地認證明驗拓撲:
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868383UtLs.jpg"></a>
實驗裝置:華為S2000交換機一台,PC機兩台
Step 1:
給兩台PC機設定IP,PC1——192.168.102.100 PC2——192.168.102.200 測試在未設定接入認證前,兩機通信情況PC1上Ping PC2
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868386MlQP.jpg"></a>
Setp 2:在交換機上設定接入認證機制,但先不設定本地信任賬戶,是以會導緻兩台主機無法通信
交換機配置: [sw]mac-authentication //交換機在全局配置模式下開啟MAC認證 [sw]int eth 1/0/1 //進入接口1 [sw-Ethernet1/0/1]mac-authentication //開啟接口1的MAC認證 [sw]int eth 1/0/2 //進入接口1 [sw-Ethernet1/0/2]mac-authentication //開啟接口1的MAC認證 在測試兩機的網絡連通性再PC1上Ping PC2 <a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868392mRqm.jpg"></a>
Setp 3:在交換機上添加兩個合法的本地登入賬号和密碼(兩台PC的MAC),讓兩台PC通過認證
PC1的MAC 000C29F4C65A PC2的MAC 3CE5A6CE1891 [sw]local-user 000C29F4C65A //添加賬戶一 [sw-luser-000c29f4c65a]password simple 000c29f4c65a //明文密碼一定要是小寫 [sw-luser-000c29f4c65a]service-type lan-access //設定本地登入 [sw]local-user 3CE5A6CE1891 //添加本地賬戶二 [sw-luser-3ce5a6ce1891]password simple 3ce5a6ce1891 //明文密碼一定要是小寫 [sw-luser-3ce5a6ce1891]service-type lan-access //設定本地登入 再次測試兩台PC的連通性 <a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_13658683940Rby.jpg"></a>
這樣一來小編的實驗也就完成了,可是這種方式隻能夠針對于一些小型企業,針對與通信營運商來說,不可能把賬戶資訊存放于網絡裝置中的,是以會借助于AAA認證來完成一系列的工作的,對于認證伺服器,小編這裡給出了兩種,一種是微軟的IAS,還有就是思科的ACS(相當強大)
下面就是小編要實作的拓撲:
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868396XF4A.jpg"></a>
實驗裝置:華為S2000交換機一台,PC機兩台,radius伺服器一台(使用windows server 2003 搭建的) IP位址規劃: PC1——192.168.102.100 SW vlan1——192.168.102.253 Radius伺服器——192.168.102.254 PC1的MAC 3CE5A6583E7E
Setp 1:配置sw
[sw]int vlan 1 //進入vlan接口模式 [sw-Vlan-interface1]ip address 192.168.102.253 255.255.255.0 //設定IP位址 [sw]radius scheme radius //建立radius認證模式,模式名為radius [sw-radius-radius]primary authentication 192.168.102.254 //設定主驗證伺服器位址 [sw-radius-radius]key authentication 123456 //設定驗證預共享密鑰 [sw-radius-radius]accounting optional //設定審計可選 [sw-radius-radius]server-type standard //設定服務類型為标準 對于認證使用者有一個區域的概念,小編這裡就當主機PC都在一個區域裡吧,交換機自帶有一個預設區域system,那麼小編就直接用就是了 [sw]domain system //進入區域 [sw-isp-system]radius-scheme radius //設定radius認證模式為小編自己建的radius
[sw-isp-system]accounting optional //設定審計可選 [sw-isp-system]access-limit enable 10 //設定同時接入認證使用者為10個,可以自由修改啦
Step 2:radius伺服器的搭建與配置,這裡有兩種分别是IAS和ACS
IAS 的搭建配置,小編這裡以截圖來示範
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868400t2Zn.jpg"></a>
打開之後按照以下三步走
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868403vgYo.jpg"></a>
之後勾選“Internet 驗證服務”
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868407SLCf.jpg"></a>
最後單擊下一步進行安裝 安裝完成之後打開Internet 驗證服務 <a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868412E9Dj.jpg"></a> 打開之後建立radius用戶端,注意這裡的radius用戶端就是網絡裝置SW <a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868415uC4G.jpg"></a> 點選完之後就會要求輸入radius用戶端的資訊,輸入點選下一步 <a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868417mlG8.jpg"></a> 之後會選擇用戶端供應商,預設即可,填入預共享密鑰123456 <a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868419drkI.jpg"></a> 點選完成即可
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868421R2u1.jpg"></a> 看到了吧,這就是小編的radius用戶端啦
當然讀者還要注意,要修改一下“遠端通路政策“,如果不清楚的話可以隻留一個政策,結果如下圖
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868425hD8q.jpg"></a>
還要添加使用者賬戶和密碼啦,右鍵“我的電腦”—》“管理”,打開本地使用者群組
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868430A8t9.jpg"></a>
定位到“使用者“子項,右鍵選擇”新使用者“
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868434OJq3.jpg"></a>
建立PC1使用者
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868438zafS.jpg"></a>
建立PC2使用者
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868440Xd31.jpg"></a>
修改兩個使用者,允許遠端接入
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868444oNwK.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868445fkNF.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_13658684517kFr.jpg"></a>
測試試試,在PC1上ping PC2
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_13658684539jfb.jpg"></a>
PC2 上ping PC1
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868455xjmb.jpg"></a>
接下來來實作ACS
在安裝ACS之前最好把IAS給解除安裝掉,以免監聽端口沖突,同時ACS是依托于java虛拟機的,是以要安裝jdk,小編這裡用的是jdk7,ACS4.0, 至于jdk的安裝小編就不細講了,直接輕按兩下下一步就是了
安裝ACS
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868457HJeN.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868461rqEA.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868465tksU.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868469EPqr.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868474O0nR.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868479UCZW.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868484pEae.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868489ciey.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868493OYci.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868499Ldct.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868503j28z.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868507rmGv.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868513v04Q.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868523wtqS.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868551TE64.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_13658685561lfE.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868562zV8f.jpg"></a>
另外一個使用者的添加相同
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868580FNPv.jpg"></a>
之後打開日志成功通路審計功能
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868594L8kX.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868613CmuQ.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868621GSfL.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868644yqzS.jpg"></a>
檢視ACS的日志審計看看
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868653wxLp.jpg"></a>
<a href="http://wnqcmq.blog.51cto.com/attachment/201304/13/5200614_1365868684wj1L.jpg"></a>
好了,到此為止所有的工作都完成了,讀者可以做一下擴充,比如說在不同網段實作認證(小編這裡都是相同網段的,企業不會這麼來幹的),以上所有僅僅是給讀者一個基礎的學習引導,希望對讀者你有所幫助啊
本文轉自 chenming421 51CTO部落格,原文連結:http://blog.51cto.com/wnqcmq/1177774