GRE over IPsecVPN配置

拓扑图:

在三个路由器上面配置OSPF路由,实现基本的通信(略)  

 

1. 配置ACL 和 NAT :

  - 总公司:

R1(config)#ip access-list extended 100 
R1(config-ext-nacl)#10 permit ip 192.168.10.0 0.0.0.255 any
R1(config-ext-nacl)#exit

R1(config)#ip nat pool pat-pool 58.1.1.1 58.1.1.1 netmask 255.255.255.0

R1(config)#ip nat inside source list 100 pool pat-pool overload 

R1(config)#int f0/0
R1(config-if)#ip nat inside 
R1(config-if)#int s0/3/0
R1(config-if)#ip nat outside 
R1(config-if)#exit

  - 分公司:

R3(config)#ip access-list extended 100
R3(config-ext-nacl)#10 permit ip 192.168.100.0 0.0.0.255 any

R3(config)#ip nat pool pat-pool 108.1.1.2 108.1.1.2 netmask 255.255.255.0
R3(config)#ip nat inside source list 100 pool pat-pool overload 

R3(config)#int f0/0
R3(config-if)#ip nat inside 
R3(config-if)#int s0/3/0
R3(config-if)#ip nat outside 
R3(config-if)#exit

2. 配置GRE隧道:

总公司 配置 GRE vpn:

R1(config)#int tunnel 1

R1(config-if)#ip add 10.1.1.1 255.255.255.252

R1(config-if)#tunnel source serial 0/3/0
R1(config-if)#tunnel destination 108.1.1.2
R1(config-if)#exit

分公司 配置 GRE vpn:

R3(config)#interface tunnel 1

R3(config-if)#ip add 10.1.1.2 255.255.255.252

R3(config-if)#tunnel source serial 0/3/0
R3(config-if)#tunnel destination 58.1.1.1
R3(config-if)#exit

3. 配置 默认路由

总公司 - 默认路由:

R1(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2
# 或者也可以使用静态路由:
/* ### ip route 192.168.100.0 255.255.255.0 10.1.1.2 */

分公司 - 默认路由:

R1(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1
# 或者也可以使用静态路由:
/* ### ip route 192.168.10.0 255.255.255.0 10.1.1.1 */

4. 配置IPsecVPN

   总公司 - IPsec:

R1(config)#crypto isakmp enable 

R1(config)#crypto isakmp policy 1
R1(config-isakmp)#encryption aes 256
R1(config-isakmp)#hash sha 
R1(config-isakmp)#authentication pre-share 
R1(config-isakmp)#group 2
R1(config-isakmp)#lifetime 86400
R1(config-isakmp)#exit

R1(config)#crypto isakmp key ccie address 108.1.1.2

R1(config)#crypto ipsec transform-set gs12 esp-aes 256 esp-sha-hmac 

R1(config)#access-list 180 permit gre host 58.1.1.1 host 108.1.1.2 

R1(config)#crypto map vpnmap 2 ipsec-isakmp 
R1(config-crypto-map)#match address 180
R1(config-crypto-map)#set peer 108.1.1.2
R1(config-crypto-map)#set transform-set gs12
R1(config-crypto-map)#exit

R1(config)#int s0/3/0
R1(config-if)#crypto map vpnmap
R1(config-if)#exit

   分公司 - IPsec:

R3(config)#  crypto isakmp enable 

R3(config)#crypto isakmp policy 1

R3(config-isakmp)#encryption aes 256
R3(config-isakmp)#hash sha 
R3(config-isakmp)#authentication pre-share 
R3(config-isakmp)#group 2
R3(config-isakmp)#lifetime 86400
R3(config-isakmp)#exit

R3(config)#crypto isakmp key ccie address 58.1.1.1

R3(config)#crypto ipsec transform-set gs12 esp-aes 256 esp-sha-hmac 

R3(config)#access-list 180 permit gre host 108.1.1.2 host 58.1.1.1

R3(config)#crypto map vpnmap 2 ipsec-isakmp 
R3(config-crypto-map)#match address 180
R3(config-crypto-map)#set peer 58.1.1.1
R3(config-crypto-map)#set transform-set gs12
R3(config-crypto-map)#exit

R3(config)#int s0/3/0
R3(config-if)#crypto map vpnmap
R3(config-if)#exit

数据包分析

IPsecVPN数据包:

/**声明**/

该实验是从网上用来发现并且仅用于学习使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值