大家好,今天我們來學習交流一下Cisco路由器Easy VPN的配置。
通過本文實驗,主要了解為以下幾點
1、掌握如何在路由器上配置 Easy VPN。
2、掌握 VPN Client 的使用。
實驗環境
1、PC 機1臺、服務器 1 臺;
2、思科 2811 路由器4 臺;
3、軟件工具:Cisco PT 5.3-6.0、Windows XP/7/10 操作系統。
實驗參考拓撲
實驗內容
本項目中路由器 ISP 模擬 Internet,路由器 Remote模擬出差員工所在的酒店,酒店通常會採用 NAT 實現上網, 路由器 Enterprice和 Center 模擬企業內部網絡; 要求實現員工在外地酒店內能夠和企業總部的網通信,員工的筆記本上要安裝 VPN客戶端軟件。
實驗參考步驟
(1)IP 地址及路由配置
在 4臺路由器上配置 IP地址,測試各直接鏈路的連通性,並配置路由和 NAT
Remote(config)#ip route 0.0.0.0 0.0.0.0 serial0/0/0
Enterprise(config)#ip route 0.0.0.0 0.0.0.0 serial0/0/0
在企業總部內部配置 RIPv2路由協議
Enterprise(config)#router rip
Enterprise(config-router)#version 2
Enterprise(config-router)#no auto-summary
Enterprise(config-router)#network 172.16.0.0
Enterprise(config-router)#redistribute static //把靜態路由發佈給路由器Center,靜態路由包含了默認路由以及 VPN客戶連通後自動產生的主機路由
Center(config)#router rip
Center(config-router)#version 2
Center(config-router)#no auto-summary
Center(config-router)#network 172.16.0.0
酒店通常會使用 NAT 上網
Remote(config)#iinterface serial0/0/0
Remote(config-if)#ip nat outside
Remote(config)#iinterface fastethernet0/0
Remote(config-if)#ip nat inside
Remote(config)#access-list 1 permit 192.168.1.0 0.0.0.255
Remote(config#ip nat inside source list 1 serial0/0/0 overload
在筆記本上配置 IP 地址為 192.168.1.2/24,網關為:192.168.1.1,測試能夠 ping 通模擬 VPN網關的路由器 Enterprise(218.30.1.2)。
(2)在路由器 Enterprise上配置 Easy VPN
1)定義 isakmp(Internet 安全關聯和密鑰管理協議 ( 第一階段 IPSEC)
Enterprise(config)#crypto isakmp policy 1 //定義 isakmp策略
Enterprise(config-isakmp)#encrytions 3des //配置 isakmp 採用什麼加密算法,可以選擇 DES、3DES 和 AES
Enterprise(config-isakmp)#hash md5 //配置 isakmp 採用什麼 HASH 算法,可以選擇 MD5和 SHA
Enterprise(config-isakmp)#authentication pre-share // 配置 isakmp 採用什麼身份認證算法,這裡採用預共享密碼進行認證。
Enterprise(config-isakmp)#group 2 //配置isakmp採用什麼密鑰交換算法。可選擇 1、2和 5,2表示使用客戶端軟件進行登錄
2)設置推送到客戶端的組策略
Enterprise(config)#ip local pool REMOTE-POOL 172.16.100.1 172.16.100.254 //定義 IP 地址池,用於向 VPN客戶分配 IP 地址
3)定義組策略
Enterprise(config)#crypto isakmp client configuration group VPN-REMOTE-ACCESS //創建一個組策略,組名為:VPN-REMOTE-ACCESS,要對該組的屬性進行設置
Enterprise(config-isakmp-group)#key 123 //設置組的密碼
Enterprise(config-isakmp-group)#pool REMOTE-POOL // 配置該組的用戶將採用的 IP 地址池
Enterprise(config)#aaa new-model //啟用 AAA 功能
Enterprise(config)#aaa authorization network VPN-REMOTE-ACCESS local //定義在本地進行授權
Enterprise(config)#crypto map CLIENTMAP isakmp authorization list VPN-REMOTE-ACCESS //指明 isakmp的授權方式
Enterprise(config)#crypto map CLIENTMAP client configuration address respond //配置當用戶請求 IP 地址時就響應地址請求
6)定義交換集 (第二階段 IPSEC)
Enterprise(config)#crypto ipsec transform-set VPNTRANSFORM esp-3des esp-md5-hmac //定義一個交換集
7)定義加密圖
Enterprise(config)#crypto dynamic-map DYNMAP 1 //創建一個動態加密圖,加密圖之所以是動態,是因為無法預知客戶端的 IP 地址
Enterprise(config-crypto-map)#set transform-set VPNTRANSFORM //指明加密圖的交換集
Enterprise(config-crypto-map)#reverse-route //反向路由注入
Enterprise(config)#crypto map CLIENTMAP 1 ipsec-isakmp dynamic DYNMAP //把動態加密圖應用到靜態加密圖,因為接口下只能應用靜態加密圖
8)配置認證方式
Enterprise(config)#aaa authentication login VPNUSERS local //定義一個認證方式,用戶名和密碼在本地
Enterprise(config)#username vpnuser secret cisco //定義一個用戶名和密碼
Enterprise(config)#crypto map CLIENTMAP client authentication list VPNUSERS //指明採用之前定義的認證方式對用戶進行認證
9)應用靜態加密圖
Enterprise(config)#interface serial0/0/0
Enterprise(config-if)#crypto map CLIENTMAP //在接口上應用靜態加密圖
實驗常見問題
(1)Easy VPN是 Cisco 獨有的遠程接入 VPN技術。Easy VPN是在 Ipsec VPN 建立的兩個階段(IKE 階段和 IPSEC階段)之間多了一個階段(用戶認證階段等)。
(2)程VPN接入技術,常見的有 PPTP,L2TP,Easy VPN以及 SSL VPN。
以上為本文全部內容,如有學習需要可使用Cisco PT或者其它模擬軟件進行模擬實驗。有問題也可留言提問。感謝大家的觀看。如果大家對網絡技術有興趣,歡迎大家關注。
閱讀更多 創世小偉哥 的文章