网络通信 频道

Cisco 路由器上手工方式VPN的实现

Cisco 路由器上VPN的实现:
  1、软件要求:
  需要ENTERPRISE PLUS IPSEC 56的IOS,目前使用的比较稳定版本是12.07T
  2、硬件要求:
  8 MB Flash and 40 MB RAM
  在Download IOS版本时,会提示所Download的IOS版本
  的软硬件要求。
  3、IPSec手工方式的注意事项:
  (1)加密通道一旦建立,就不再断开
  (2)Manual Key不提供anti-replay的功能
  (3)在Manual Key方式时,access-list中只有1条permit起作用,其他都被忽略。
  (4)在Manual Key方式下,两边的transform set的名字必须一样。
  4、VPN手工方式需要的主要命令:
  (1)access-list
  设置access-list,有对符合什么样条件的IP包进行加密。
  (2)crypto isakmp
  默认是使用crypto isakmp方式,所以在手工方式下,需要禁止此选项。
  (3)crypto ipsec
  配置IPSec的加密方式,选择manual方式
  (4)crypto map
  配置IPSec的加密方式
  a)set peer
  设置远程VPN网关
  b)set security-association
  设置安全联盟,主要有inbound和outbound
  c)set transform-set
  设置加密形式
  d)match address
  对匹配access-list的进行加密。
  
  5、VPN的手工实现方式:
  (1)配置access-list,对哪些包建立VPN连接。
  access-list 101 permit ip host 192.168.0.1 host
  192.168.1.1
  (2)取消VPN的自动协商方式
  no crypto isakmp enable
  (3)建立一个IPSec的封装方式—两边的路由器需要一样的名称。在举例中是encry-des
  crypto ipsec transform-set encry-desesp-des
  (4)建立一个VPN连接需要的各种条件—这里是ipsec-manual方式
  crypto map vpntest 8 ipsec-manual
  (5)在上一步用crypto map进入crypto配置模式
  a) 配置远程的VPN网关
  set peer 202.106.185.2
  b) 配置进出的安全联盟
  set security-association inbound esp 1000 cipher 21 authenticator 01
  配置入境联盟 加密方式 顺序号
  set security-association outbound esp 1001 cipher 12 authenticator 01
  c)设置IPSec的加密方式
  set transform-set encry-des
  d)对匹配地址进行加密
  match address 101
  (6)在路由器外部网口上绑定加密方式
  int e 0/1
  ip addr 202.106.185.1 255.255.255.0
  crypto map vpntest
  
  6、注意事项
  (1)在两端的access-list要互为相反,如在A路由器上写:
  access-list 101 permit ip host 192.168.0.1 host 192.168.1.1
  则在B路由器上写:
  access-list 101 permit ip host 192.168.1.1 host 192.168.0.1
  
  (2)在两端的transform set名称要一致
  如都写crypto ipsec transform-set encry-des esp-des
  
  (3)在一端的inbound就是另一端的outboud,一端的outbound是另一端的inboud。因此他们的序列好应该相反。
  如在A路由器上写:
  set security-association inbound esp 1000 cipher 21 authenticator 01
  set security-association outbound esp 1001 cipher 12 authenticator 01
  则在B路由器上写:
  set security-association inbound esp 1001 cipher 12 authenticator 01
  set security-association outbound esp 1000 cipher 21 authenticator 01
  
  (4)总之在使用手工方式时,在两端的配置应该尽量一样或相对。
  7、应用条件
  我认为在路由器上做VPN主要有以下几种应用:
  (1)可以使用在电信中二级节点和一级节点进行远程管理认证时使用。而一级节点和骨干节点由于通讯量比较大,不建议使用VPN方式。而且为了减低负载只有在传输特殊应用时建议使用VPN,不是只是简单地判断Source IP,Destination IP。
  (2)移动用户在跟自己公司的服务器进行连接时使用。
  (3)对于分公司、母公司这种形式在相互通信过程中使用。
  8、用VPN的好处
  (1)节约成本,因为不要在做大量投资,购买专业设备,只需用现有的路由器即可。
  (2)实现了加密,保证重要数据在传输过程中的安全性。
  (3)灵活性强。如果用户通过路由器接入Internet,则可以自己配置保证安全性。不过对于ISP来说用处不大。
  9、VPN应用举例:
  
  在路由器R1上配置如下:
  no crypto isakmp enable
  crypto ipsec transform-set encry-des esp-des
  crypto map vpntest 8 ipsec-manual
  set peer 202.106.185.2
  set security-association inbound esp 1000 cipher 21 authenticator 01
  set security-association outbound esp 1001 cipher 12 authenticator 01
  set transform-set encry-des match address 101
  interface Ethernet0/0
  ip address 192.168.0.1 255.255.255.0
  interface Ethernet0/1
  ip address 202.106.185.1 255.255.255.0
  crypto map vpntest
  ip route 0.0.0.0 0.0.0.0 202.106.185.2
  access-list 101 permit ip host 192.168.0.1 host 192.168.1.1
  
  
  在路由器R2上配置如下:
  no crypto isakmp enable
  crypto ipsec transform-set encry-des esp-des
  crypto map vpntest 8 ipsec-manual set peer 202.106.185.1
  set security-association inbound esp 1001 cipher 12 authenticator 01
  set security-association outbound esp 1000 cipher 21 authenticator 01
  set transform-set encry-des match address 101
  interface Ethernet0/0
  ip address 192.168.1.1 255.255.255.0
  interface Ethernet0/1
  ip address 202.106.185.2 255.255.255.0
  crypto map vpntest
  ip route 0.0.0.0 0.0.0.0 202.106.185.1
  access-list 101 permit ip host 192.168.1.1 host 192.168.0.1
  
  
  IKE方式的实现
  1、IKE使用UPD 500
  2、支持CA
  3、支持移动用户
  IKE包括的组件:
  1、DES
  2、Diffie-Hellman-preshare key
  3、RSA signatures(CA)and RSA encrypted nonces
  IKE配置内容:
  1、enable IKE—default enable
  2、accesslist
  3、transformset
  4、crypto map
  5、binding interface
  IKE Policy—两边的号码可以不一样,匹配:
  authentication、hash、diff-herman、encrytpion,lifetime(取最小值)
  1、authentication
  (1)RSA signature
  (2)RSA non
  (3)Preshare Key
  2、encryption
  
  IKE配置
  (1)配置accesslist
  (2)crypto isakmp enable(默认打开,但为了避免,还是写上)
  (3)crypto isakmp policy 10
  a)encryption algorithm:DES
  b)hash algorithm:SHA1
  c)authentication method:RSA sig
  d)Diffie-Hellman group:1
  e)Lifetime:86400
  (4)crypto isakmp key test address 202.106.100.2
  (5)crypto ipsec transform-set set2 ah-sha-hmac
  esp-des esp-sha-hmac
  (6)crypto map IKE ipsec-isakmp
  a)set peer remote IP
  b)set transform-set
  c)set pfs group2
  d)match address
  (7)dir
  使用RSA的-encr方式
  ip domain-name
  crypto key generate rsa
  sh crypto key mypubkey rsa
  crypto key pubkey-chain rsa
  key-string
  
  什么时候使用手工方式,什么时候使用IKE方式

 文章转载地址:http://cisco.chinaitlab.com/application/15004.html

0
相关文章