一、爲IPSec做準備
爲IPSec做準備涉及到確定詳細的加密策略,包括確定我們要保護的主機和網絡,選擇一種認證方法,確定有關IPSec對等體的詳細信息,確定我們所需的IPSec特性,並確認現有的訪問控制列表允許IPSec數據流通過;
步驟1:根據對等體的數量和位置在IPSec對等體間確定一個IKE(IKE階段1,或者主模式)策略;
步驟2:確定IPSec(IKE階段2,或快捷模式)策略,包括IPSec對等體的細節信息,例如IP地址及IPSec變換集和模式;
步驟3:用"write terminal"、"show isakmp"、"show isakmp
policy"、"show crypto map "命令及其他"show"命令來檢查當前的配置;
步驟4:確認在沒有使用加密前網絡能夠正常工作,用"ping"命令並在加密前運行測試數據流來排除基本的路由故障;
步驟5:確認在邊界路由器和PIX防火牆中已有的訪問控制列表允許IPSec數據流通過,或者想要的數據流將可以被過濾出來。
步驟1:用"isakmp enable"命令來啓用或關閉IKE;
步驟2:用"isakmp policy"命令創建IKE策略;
步驟3:用"isakmp key"命令和相關命令來配置預共享密鑰;
步驟4:用"show isakmp [policy]"命令來驗證IKE的配置。
三、配置IPSec
IPSec配置包括創建加密用訪問控制列表,定義變換集,創建加密圖條目,並將加密集應用到接口上去;
步驟1:用access-list命令來配置加密用訪問控制列表; 例如: access-list acl-name
{permit|deny} protocol src_addr src_mask [operator port
[port]]dest_addr dest_mask [operator prot [port]]
步驟2:用crypto ipsec transform-set 命令配置變換集; 例如: crypto
ipsec transform-set transform-set-name transform1
[transform2 [transform3]] 3.
步驟3:(任選)用crypto ipsec security-association
lifetime命令來配置全局性的IPSec 安全關聯的生存期;
步驟4:用crypto map 命令來配置加密圖;
步驟5:用interface 命令和crypto map map-name interface應用到接口上;
步驟6:用各種可用的show命令來驗證IPSec的配置。
該任務涉及到使用"show "
、"debug"和相關的命令來測試和驗證IPSec加密工作是否正常,併爲之排除故障。
樣例:
PIX 1的配置:
!configure the IP address for each PIX Firewall
interface
ip address outside 192.168.1.1 255.255.255.0
ip address inside 10.1.1.3 255.255.255.0
ip address dmz 192.168.11.1 255.255.255.0
global (outside) 1 192.168.1.10-192.168.1.254 netmask
255.255.255.0
!creates a global pooll on the outside interface,enables
NAT.
!windows NT server
static (inside,outside) 192.168.1.10 10.1.1.4 netmask
255.255.255.0
!Crypto access list specifiles between the global and
the inside server beind PIX Firewalls is encrypted ,The
source and destination IP address are the global IP
addresses of the statics.
Access-list 101 permit ip host 192.168.1.10 host
192.168.2.10
!The conduit permit ICMP and web access for testing.
Conduit permit icmp any any Conduit permit tcp host
192.168.1.10 eq www any
route outside 0.0.0.0 0.0.0.0 192.168.1.2 1
!Enable IPSec to bypass access litst,access ,and confuit
restrictions
syspot connnection permit ipsec
!Defines a crypto map transform set to user esp-des
crypto ipsec transform-set pix2 esp-des
crypto map peer2 10 ipsec-isakmp!
完全配置:
ip address outside 202.105.113.194 255.255.255.0
/*看電信給你的IP
ip address inside 192.168.1.1 255.255.255.0
!
global (outside) 1 202.105.113.195-202.105.113.200
global (outside) 1 202.105.113.201
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) 202.105.113.203 192.168.1.10
netmask 255.255.255.255 0 0
static (inside,outside) 202.105.113.205
192.168.1.11netmask 255.255.255.255 0 0
conduit permit icmp any any conduit permit tcp host
202.105.113.203 eq www any
conduit permit tcp host 202.105.113.203 eq ftp any
conduit permit tcp host 202.105.113.205 eq smtp any
conduit permit tcp host 202.105.113.205 eq pop3 any
!
route outside 0.0.0.0 0.0.0.0 202.105.113.193 1
route inside 0.0.0.0 0.0.0.0 192.168.1.1