Current configuration:
!
version 12.2
service timestamps debug uptime
service timestamps log up time
no service password-encryption
!
hostname sam-i-am
!
ip subnet-zero
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0 //配置静态路由协议
no ip http server
!
access-list 115 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255
access-list 115 deny ip 10.2.2.0 0.0.0.255 any
!
access-list 120 deny ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255
access-list 120 permit ip 10.2.2.0 0.0.0.255 any
!
sam-i-am(config)#route-map nonat permit 10 //使用路由策略
sam-i-am(router-map)#match ip address 120
!
line con 0
transport input none
line aux 0
line vty 0 4
password ww
login
!
end
Router:dr_whoovie(VPN Client)
Current configuration:
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname dr_whoovie
!
ip subnet-zero
!
dr_whoovie(config)#crypto isakmp policy 1 //定义策略为1
dr_whoovie(isakmp)#hash md5 //定义MD5散列算法
dr_whoovie(isakmp)#authentication pre-share //定义为预共享密钥认证方式
dr_whoovie(config)#crypto isakmp key cisco123 address 99.99.99.1
!
interface Ethernet0
ip address 10.1.1.1 255.255.255.0
no ip directed-broadcast
ip nat inside
no mop enabled
!
interface Serial0
ip address negotiated //IP地址自动获取
no ip directed-broadcast
ip nat outside
encapsulation ppp //S0接口封装ppp协议
no ip mroute-cache
no ip route-cache
crypto map rtp //将保密映射应用到S0接口上
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0 //配置静态路由协议
no ip http server
!
access-list 115 permit ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255
access-list 115 deny ip 10.1.1.0 0.0.0.255 any
access-list 120 deny ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255
access-list 120 permit ip 10.1.1.0 0.0.0.255 any
!
dialer-list 1 protocol ip permit
dialer-list 1 protocol ipx permit
route-map nonat permit 10 //使用路由策略
match ip address 120
!
line con 0
transport input none
line aux 0
line vty 0 4
password ww
login
!
end
-----------IKE配置----------------
IPSec VPN对等端为了建立信任关系,必须交换某种形式的认证密钥。
Internet 密钥交换(Internet Key Exchange,IKE)是一种为IPSec管理和交换密钥的标准方法。
一旦两个对等端之间的IKE协商取得成功,那么IKE就创建到远程对等端的安全关联(security association,SA)。SA是单向的;在两个对等端之间存在两
个SA。
IKE使用UDP端口500进行协商,确保端口500不被阻塞。