IPsecOverGRE
IPsecOverGRE
R3的公网接口为f0/1.
crypto isakmp policy 10 crypto isakmp key cisco address 3.3.3.3 255.255.255.0 crypto isakmp key cisco address 23.23.23.2 255.255.255.0 ! ! crypto ipsec transform-set VPNSET esp-3des esp-md5-hmac ! crypto map
VPNMAP local-address Loopback100 crypto map VPNMAP 10 ipsec-isakmp ! ! interface Tunnel0 //GRE配置 ! router eigrp 100 ! ip route 0.0.0.0 0.0.0.0 12.12.12.2 ! ip access-list extended VPNACL ! |
uIPsecOverGRE封装过程
当172.16.1.1 ping 172.16.2.1时,首先查找路由表,发现下一跳路由是192.168.1.2,本地的出口为Tunnel0口。所以把数据包由tunnel0转发,当转发时,有一条crypto map VPNMAP加密映射图,VPNMAP中的感兴趣流量中VPNACL正好匹配了172.16.1.1 到172.16.2.1,所以要用ESP保护流量。对该数据包进行重新封装,添加新的源IP(1.1.1.1)和目的IP(3.3.3.3). 再有tunnel口通过GRE出去。GRE的源IP为12.12.12.1,目的为3.3.3.3.再次查看路由再由物理口出去。下图是封装格式: |
u
crypto isakmp policy 10 crypto isakmp key cisco address 1.1.1.1 255.255.255.0 crypto
isakmp key cisco address 12.12.12.1 255.255.255.0 ! ! crypto ipsec transform-set VPNSET esp-3des esp-md5-hmac ! crypto map
VPNMAP local-address Loopback100 crypto map VPNMAP 10 ipsec-isakmp ! ! interface Tunnel0 //GRE配置 ! router eigrp 100 ! ip route 0.0.0.0 0.0.0.0 23.32.23.1 ! ip access-list extended VPNACL ! |