NAT(config)#username velino password 0 123456 //设置用户名密码(vpn client连接后提示的用户名和密码)
!
NAT(config)#aaa new-model //启用AAA认证
!
NAT(config)#aaa authentication login vpn-authen local //设置AAA认证组vpn-authen为本地认证
NAT(config)#crypto isakmp xauth timeout 20 //设置扩展策略认证超时时间(秒)
NAT(config)#crypto map cisco client authentication list vpn-authen //设置VPN模板cisco为认证组vpn-authen
!
NAT(config)#aaa authorization network vpn-author local //设置认证网络组vpn-author为本地地址池
!
NAT(config)#ip local pool vpn-pool 172.16.0.1 172.16.0.3 //设置本地地址池vpn-pool的地址范围为172.16.0.1到172.16.0.2
!
NAT(config)#crypto map cisco client configuration address respond //响应来自VPN策略cisco的地址请求
!
NAT(config)#access-list 100 permit ip 10.10.246.0 0.0.0.255 any //设置内网的ACL
!
NAT(config)#crypto isakmp client configuration group mobile //设置VPN客户组mobile(vpn client中需要的)
NAT(config-isakmp-group)#key velino //设置VPN客户组密钥为velino(vpn client中需要的)
NAT(config-isakmp-group)#pool vpn-pool //设置地址池为vpn-pool
!
NAT(config-isakmp-group)#acl 100 //应用ACL,不设置这个只能拨入不能访问内部网络
!
NAT(config-isakmp-group)#exit
!
NAT(config)#crypto map cisco isakmp authorization list vpn-author //设置VPN策略cisco到AAA认证地址池
!
NAT(config)#crypto isakmp policy 1 //建立ISAKMP策略
NAT(config-isakmp)#encryption 3des //设置加密算法
NAT(config-isakmp)#authentication pre-share //设置共享密钥
NAT(config-isakmp)#group 2 //设置密钥长度为1024
NAT(config-isakmp)#hash md5 //设置为MD5认证
!
NAT(config-isakmp)#exit
!
NAT(config)#crypto ipsec transform-set vpn-set esp-3des esp-md5-hmac //设置转换集vpn-set
!
NAT(cfg-crypto-trans)#exit
!
NAT(config)#crypto dynamic-map vpn-dyn 1 //建立动态模板映射
NAT(config-crypto-map)#set transform-set vpn-set //设置转换集vpn-set
!
NAT(config-crypto-map)#exit
!
NAT(config)#crypto map cisco 1 ipsec-isakmp dynamic vpn-dyn //将组策略、Xauth应用到动态映射
!
NAT(config)#interface fastEthernet 0/0
NAT(config-if)#crypto map cisco //加载MAP cisco
NAT(config-if)#exit
!
设置NAT的时候
access-list 101 deny ip 10.10.0.0 0.0.255.255 host 172.16.0.1
access-list 101 deny ip 10.10.0.0 0.0.255.255 host172.16.0.2
access-list 101 deny ip 10.10.0.0 0.0.255.255 host 172.16.0.3
access-list 101 permit ip 10.10.0.0 0.0.255.255 any //设置内部网络阻止访问VPN客户端
access-list 1 permit 10.10.246.0 0.0.0.255
route-map ADSL permit 1
match ip address 101
exit
ip nat inside source route-map ADSL interface Dialer0 overload
interface
FastEthernet0/0
ip nat inside
exit
interface
Dialer0
ip nat outside
exit