GRE Over IPSec

GRE Over IPSec


GRE Over IPSec配置命令:

创建GRE隧道:
GW(config)#interface tunnel 0            //启用一个虚拟隧道接口,ID两端可以不匹配
GW(config-if)#ip address 12.12.12.1 255.255.255.0    //为隧道配置隧道IP
GW(config-if)#tunnel source f 0/0               //隧道源是自己的公网IP或者端口
GW(config-if)#tunnel destination 172.16.2.2    //隧道目的是对方的站点公网IP
GW(config)#ip route 192.168.30.0 255.255.255.0 12.12.12.2    //配置静态路由把目标数据引入GRE隧道
Branch(config)#interface tunnel 0   
Branch(config-if)#ip address 12.12.12.2 255.255.255.0
Branch(config-if)#tunnel source f 0/1
Branch(config-if)#tunnel destination 172.16.1.1
Branch(config)#ip route 192.168.0.0 255.255.0.0 12.12.12.1

GW路由配置IPSec:
GW(config)#crypto isakmp enable            //启用IKE
GW(config)#crypto isakmp policy 1          //配置第一阶段策略
GW(config-isakmp)#authentication pre-share     //配置认证方式为与共享密钥
GW(config-isakmp)#encryption 3des           //配置加密方式为DES
GW(config)#crypto isakmp key cisco address 172.16.2.2  //配置Pre-share的密钥,指定address为对端接口IP
GW(config)#crypto ipsec transform-set myset esp-des esp-md5-hmac  //配置第二阶段策略(隧道模式)
GW(config)#crypto map mymap 5 ipsec-isakmp //用VPN的map将感兴趣流关联到第二阶段策略
GW(config-crypto-map)#set peer 172.16.2.2  //指定peer为对端的接口IP
GW(config-crypto-map)#set transform-set myset  //配置匹配的转换集
GW(config-crypto-map)#match address VPN        //配置匹配的数据流(映射ACL)
GW(config)#ip access-list extended VPN
GW(config-ext-nacl)#permit gre host 172.16.1.1 host 172.16.2.2 //用ACL指定保护GRE隧道所有数据
GW(config)#interface f 0/0
GW(config-if)#crypto map mymap       //把Crypto Map应用到VPN网关的隧道接口
(需要重分布默认路由进OSPF)     //把内网数据发送到网关

Branch路由配置IPSec:
Branch(config)#crypto isakmp enable
Branch(config)#crypto isakmp policy 1
Branch(config-isakmp)#authentication pre-share
Branch(config-isakmp)#encryption 3des
Branch(config)#crypto isakmp key cisco address 172.16.1.1
Branch(config)#crypto ipsec transform-set myset esp-des esp-md5-hmac
Branch(config)#crypto map mymap 5 ipsec-isakmp
Branch(config-crypto-map)#set peer 172.16.1.1
Branch(config-crypto-map)#set transform-set myset
Branch(config-crypto-map)#match address VPN
Branch(config)#ip access-list extended VPN
Branch(config-ext-nacl)#permit gre host 172.16.2.2 host 172.16.1.1
Branch(config)#interface f 0/1
Branch(config-if)#crypto map mymap
(需要重分布默认路由进OSPF)




  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值