思科路由器动态VTI IPSecVPN配置

简介:

1.拓扑图:


222858514.jpg

2.基本接口配置:

A.R1:

R1(config)#int f0/0
R1(config-if)#ip add 202.100.12.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int l0
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#int l1
R1(config-if)#ip add 192.168.1.1 255.255.255.0

B.R2:

R2(config)#int f0/0
R2(config-if)#ip add 202.100.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int f0/1
R2(config-if)#ip add 202.100.23.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int f1/0
R2(config-if)#ip add 202.100.24.2 255.255.255.0
R2(config-if)#no sh

C.R3:

R3(config)#int f0/0
R3(config-if)#ip add 202.100.23.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int l0
R3(config-if)#ip add 172.16.1.3 255.255.255.0
R3(config-if)#int l1
R3(config-if)#ip add 192.168.3.3 255.255.255.0

D.R4:

R4(config)#int f1/0
R4(config-if)#ip add 202.100.24.4 255.255.255.0 
R4(config-if)#no sh
R4(config-if)#int l0
R4(config-if)#ip add 172.16.1.4 255.255.255.0
R4(config-if)#int l1
R4(config-if)#ip add 192.168.4.4 255.255.255.0

3.静态路由配置

R1(config)#ip route 0.0.0.0 0.0.0.0 202.100.12.2

R3(config)#ip route 0.0.0.0 0.0.0.0 202.100.23.2

R4(config)#ip route 0.0.0.0 0.0.0.0 202.100.24.2

4.动态VTI配置:

A.HUB:

①第一阶段:

R1(config)#crypto isakmp policy 10
R1(config-isakmp)#au pre
R1(config-isakmp)#ha md
R1(config-isakmp)#en 3des
R1(config-isakmp)#gr 2
R1(config-isakmp)#exit

R1(config)#crypto keyring R1
R1(conf-keyring)#pre-shared-key address 202.100.23.3 key cisco
R1(conf-keyring)#pre-shared-key address 202.100.24.4 key cisco

R1(config)#crypto isakmp profile isakmppro
R1(conf-isa-prof)#keyring R1
R1(conf-isa-prof)#match identity address 202.100.23.3 
R1(conf-isa-prof)#match identity address 202.100.24.4
R1(conf-isa-prof)#virtual-template 1

②第二阶段:

R1(config)#crypto ipsec transform-set transet esp-3des esp-sha-hmac

③ipsec profile关联第一阶段和第二阶段策略:

R1(config)#crypto ipsec profile ipsecpro   
R1(ipsec-profile)#set isakmp-profile isakmppro
R1(ipsec-profile)#set transform-set transet

④VTI配置

R1(config)#int virtual-template 1 type tunnel 
R1(config-if)#
ip unnumbered loopback 0
R1(config-if)#tunnel mode ipsec ipv4
R1(config-if)#tunnel protection ipsec profile ipsecpro

B.Spoke1:

①第一阶段:

R3(config)#crypto isakmp policy 10
R3(config-isakmp)#au pr
R3(config-isakmp)#en 3des
R3(config-isakmp)#gr 2
R3(config-isakmp)#ha md
R3(config-isakmp)#exit
R3(config)#crypto isakmp key 0 cisco address 202.100.12.1

②第二阶段:

R3(config)#crypto ipsec transform-set transet esp-3des esp-sha-hmac

③ipsec profile关联第二阶段策略:

R3(config)#crypto ipsec profile ipsecpro
R3(ipsec-profile)#set transform-set transet
R3(ipsec-profile)#exit

④VTI配置

R3(config)#int tunnel 0
R3(config-if)#
ip unnumbered loopback 0
R3(config-if)#tunnel source f0/0
R3(config-if)#tunnel destination 202.100.1.1
R3(config-if)#tunnel mode ipsec ipv4
R3(config-if)#tunnel protection ipsec profile ipsecpro
R3(config-if)#exit

C.Spoke2:

①第一阶段:

R4(config)#crypto isakmp policy 10
R4(config-isakmp)#au pr
R4(config-isakmp)#au pre-share 
R4(config-isakmp)#ha md
R4(config-isakmp)#en 3de
R4(config-isakmp)#gr 2
R4(config-isakmp)#exit
R4(config)#crypto isakmp key 0 cisco address 202.100.12.1

②第二阶段:

R4(config)#crypto ipsec transform-set transet esp-3des esp-sha-hmac
R4(cfg-crypto-trans)#exit

③ipsec profile关联第二阶段策略:

R4(config)#crypto ipsec profile ipsecpro
R4(ipsec-profile)#set transform-set transet
R4(ipsec-profile)#exit


④VTI配置

R4(config-if)#int tun 0
R4(config-if)#
ip unnumbered loopback 0
R4(config-if)#tunnel source f1/0
R4(config-if)#tunnel destination 202.100.12.1
R4(config-if)#tunnel mode ipsec ipv4
R4(config-if)#tunnel protection ipsec profile ipsecpro

5.动态路由配置:

R1(config)#router eigrp 10
R1(config-router)#no auto-summary 
R1(config-router)#net 172.16.1.0 0.0.0.255
R1(config-router)#net 192.168.1.0 0.0.0.255

R3(config)#router eigrp 10
R3(config-router)#no auto-summary 
R3(config-router)#net 172.16.1.0 0.0.0.255
R3(config-router)#net 192.168.3.0 0.0.0.255


R4(config)#router eigrp 10
R4(config-router)#no auto-summary 
R4(config-router)#net 172.16.1.0 0.0.0.255
R4(config-router)#net 192.168.4.0 0.0.0.255

6.验证:

R1#show ip int brief 
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            202.100.12.1    YES NVRAM  up                    up      
FastEthernet0/1            unassigned      YES NVRAM  administratively down down    
Virtual-Access1            unassigned      YES unset  down                  down    
Virtual-Template1          172.16.1.1      YES TFTP   down                  down    
Virtual-Access2            172.16.1.1      YES TFTP   up                    up      
Virtual-Access3            172.16.1.1      YES TFTP   up                    up      
Loopback0                  172.16.1.1      YES manual up                    up      
Loopback1                  192.168.1.1     YES manual up                    up  

R1#show crypto isakmp sa 
IPv4 Crypto ISAKMP SA
dst             src             state          conn-id slot status
202.100.12.1    202.100.23.3    QM_IDLE           1001    0 ACTIVE
202.100.12.1    202.100.24.4    QM_IDLE           1002    0 ACTIVE

R1#show crypto engine connections active 
Crypto Engine Connections

  ID Interface  Type  Algorithm           Encrypt  Decrypt IP-Address
   1 Fa0/0      IPsec 3DES+SHA                  0      422 202.100.12.1
   2 Fa0/0      IPsec 3DES+SHA                426        0 202.100.12.1
   5 Fa0/0      IPsec 3DES+SHA                  0      103 202.100.12.1
   6 Fa0/0      IPsec 3DES+SHA                205        0 202.100.12.1
1001 Fa0/0      IKE   MD5+3DES                  0        0 202.100.12.1
1002 Fa0/0      IKE   MD5+3DES                  0        0 202.100.12.1

R1#ping 192.168.3.3 source 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.3, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 84/116/136 ms

R1#ping 192.168.4.4 source 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.4, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/105/128 ms

R1#show ip route eigrp 
D    192.168.4.0/24 [90/297372416] via 172.16.1.4, 00:13:59, Virtual-Access3
D    192.168.3.0/24 [90/297372416] via 172.16.1.3, 00:14:50, Virtual-Access2

R3#show ip route eigrp 
D    192.168.4.0/24 [90/310172416] via 172.16.1.1, 00:13:46, Tunnel0
D    192.168.1.0/24 [90/297372416] via 172.16.1.1, 00:14:55, Tunnel0

R4#show ip route eigrp 
D    192.168.1.0/24 [90/297372416] via 172.16.1.1, 00:01:14, Tunnel0
D    192.168.3.0/24 [90/310172416] via 172.16.1.1, 00:00:55, Tunnel0






本文转自 碧云天 51CTO博客,原文链接:http://blog.51cto.com/333234/910931,如需转载请自行联系原作者

相关文章
|
弹性计算 安全 Linux
SSL-VPN和客户端配置|学习笔记
快速学习SSL-VPN和客户端配置
1386 0
SSL-VPN和客户端配置|学习笔记
|
安全 网络协议 测试技术
|
2月前
|
安全 算法 网络安全
IPSec VPN配置实验
IPSec VPN配置实验
54 7
|
2月前
|
网络虚拟化
配置BGP/MPLS IP VPN示例
配置BGP/MPLS IP VPN示例
|
9月前
|
安全 网络虚拟化 数据安全/隐私保护
Windows 10系统自带VPN客户端配置连接PPTP VPN服务器
Windows 10系统自带VPN客户端配置连接PPTP VPN服务器
1510 1
|
2月前
|
存储 弹性计算 负载均衡
ECS配置问题之配置OPENVPN报错如何解决
ECS配置指的是对阿里云Elastic Compute Service(弹性计算服务)实例的硬件和软件资源进行设置的过程;本合集将详述如何选择合适的ECS配置、调整资源配比以及优化实例性能,以满足不同应用场景的需求。
|
9月前
|
网络协议 网络虚拟化
MPLS VPN Hub&Spole理论及实验配置
MPLS VPN Hub&Spole理论及实验配置
76 0
|
9月前
|
安全 网络安全 网络虚拟化
企业路由器配置PPTP PC到站点模式VPN指南(外网访问内网资源)
企业路由器配置PPTP PC到站点模式VPN指南(外网访问内网资源)
228 0
|
安全 网络协议 Java
思科ASA防火墙配置SSL远程VPN
使用SSL(Secure Socket Layer,安全套接层);VPN可以更加方便地实现远程安全接入。SSL VPN不需要在用户计算机安装特殊软件,可以使用当前用户计算机地浏览器安全地访问公司内部服务器。SSL VPN除了浏览器外,还可以通过浏览器自动安装客户端软件到用户计算机上,本章主要介绍SSL VPN地原理,配置与实现。
思科ASA防火墙配置SSL远程VPN
|
网络安全 网络虚拟化 数据安全/隐私保护
ASA防火墙和路由器配置IPSec VPN
ASA防火墙和路由器配置IPSec VPN
ASA防火墙和路由器配置IPSec VPN