IPSec站点到站点 配置实例

简介: 文章目录实验拓扑实验要求实验配置

实验拓扑



实验要求

本次实验只是给出一个IPSec站点到站点 配置实例,并不给出具体解释。

本次实验由三台7200平台路由器完成,其中端口连接如上图所示,R1和R3上存在环回口1.1.1.1和3.3.3.3。全网运行EIGRP保证各个接口可达。

实验配置

R1:
R1#conf t
R1(config)#int f0/0 
R1(config-if)#ip add 10.10.12.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int loo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#no sh
R2:
R2#conf t
R2(config)#int f0/1 
R2(config-if)#ip add 10.10.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int f0/0
R2(config-if)#ip add 10.10.23.2 255.255.255.0 
R2(config-if)#no sh
R2(config-if)#int loo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no sh
R3:
R3#conf t
R3(config)#int f0/1
R3(config-if)#ip add 10.10.23.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#no sh
R1;
R1(config)#router eigrp 1
R1(config-router)#net 1.1.1.0
R1(config-router)#net 10.10.12.0
R2:
R2(config)#router eigrp 1
R2(config-router)#net 2.2.2.0
R2(config-router)#net 10.10.12.0 
R2(config-router)#net 10.10.23.0
R3:
R3(config)#router eigrp 1
R3(config-router)#net 3.3.3.0  
R3(config-router)#net 10.10.23.0

配置好R1,R2和R3的相关接口的IP地址,并且在全网运行EIGRP,使得各个接口直接可达。

在配置完成后查看R1和R3的路由表。



现要求配置R1到R3的站点到站点 IPSec VPN 并且对1.1.1.1到3.3.3.3的流量进行加密。那么分别在R1和R3上进行配置。

其中R1的配置如下:

R1(config)#crypto isakmp policy 10 //定义阶段1SA的策略
R1(config-isakmp)#authentication pre-share //预共享密钥以及对端IP地址
R1(config-isakmp)#encryption ?
  3des  Three key triple DES
  aes   AES - Advanced Encryption Standard.
  des   DES - Data Encryption Standard (56 bit keys).
R1(config-isakmp)#encryption 3des //加密算法为3DES
R1(config-isakmp)#group 5
R1(config-isakmp)#hash sha //hash 算法为 sha
R1(config-isakmp)#exit
R1(config)#crypto isakmp key cisco address 10.10.23.3 //定义预共享密钥以及对端IP地址
R1(config)#access-list 100 permit ip host 1.1.1.1 host 3.3.3.3 //定义加密ACL即选出需要加密的流量
R1(config)#crypto ipsec transform-set myset esp-3des esp-sha-hmac //定义变集
R1(cfg-crypto-trans)#crypto map mymap 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
  and a valid access list have been configured.
R1(config-crypto-map)#set peer 10.10.23.3
R1(config-crypto-map)#set transform-set myset
R1(config-crypto-map)#match address 100
R1(config-crypto-map)#exit
 //上述命令定义是一个加密图
 R1(config)#int f0/0
R1(config-if)#crypto map mymap  //将加密图mymap使用在接口F0/0上

同样的,由于该IPSec VPN 也是单向的,因此需要在R3上进行返回流量配置。

R3(config)#crypto isakmp policy 10
R3(config-isakmp)#authentication pre-share
R3(config-isakmp)#encryption 3des
R3(config-isakmp)#group 5
R3(config-isakmp)#sash sha
                  ^
% Invalid input detected at '^' marker.
R3(config-isakmp)#hash sha
R3(config-isakmp)#exit
R3(config)#crypto isakmp key cisco address 10.10.12.1 
R3(config)#access-list 100 permit ip host 3.3.3.3 host 1.1.1.1
R3(config)#crypto ipsec transform-set myset esp-3des esp-sha-hmac
R3(cfg-crypto-trans)#exit
R3(config)#crypto map mymap 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
  and a valid access list have been configured.
R3(config-crypto-map)#set peer 10.10.12.1 
R3(config-crypto-map)#set transform-set myset
R3(config-crypto-map)#match address 100
R3(config-crypto-map)#exit
R3(config)#int f0/1
R3(config-if)#crypto map mymap
R3(config-if)#
*May 16 15:45:44.459: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON
R3(config-if)#exit


配置完毕后,需要注意,两端的阶段一和阶段二的各种认证加密策略必须要一致。

在R1上验证去往R3的环回口3.3.3.3。

R1#ping 3.3.3.3 source lo0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/93/108 ms
R1#

上述命令是查看阶段一的 SA。

R1#show crypto ipsec sa
interface: FastEthernet0/0
    Crypto map tag: mymap, local addr 10.10.12.1
   protected vrf: (none)
   local  ident (addr/mask/prot/port): (1.1.1.1/255.255.255.255/0/0)
   remote ident (addr/mask/prot/port): (3.3.3.3/255.255.255.255/0/0)
   current_peer 10.10.23.3 port 500
     PERMIT, flags={origin_is_acl,}
    #pkts encaps: 9, #pkts encrypt: 9, #pkts digest: 9
    #pkts decaps: 9, #pkts decrypt: 9, #pkts verify: 9
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 1, #recv errors 0
     local crypto endpt.: 10.10.12.1, remote crypto endpt.: 10.10.23.3
     path mtu 1500, ip mtu 1500
     current outbound spi: 0x77DBD158(2010894680)
     inbound esp sas:
      spi: 0x58A96EBA(1487498938)
        transform: esp-3des esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 2001, flow_id: SW:1, crypto map: mymap
        sa timing: remaining key lifetime (k/sec): (4552411/2905)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE
     inbound ah sas:
     inbound pcp sas:
     outbound esp sas:
      spi: 0x77DBD158(2010894680)
        transform: esp-3des esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 2002, flow_id: SW:2, crypto map: mymap
        sa timing: remaining key lifetime (k/sec): (4552411/2896)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE
     outbound ah sas:
     outbound pcp sas:

上述命令是查看阶段二的SA。

目录
相关文章
|
2天前
|
数据可视化 Linux Docker
导航页配置服务Dashy本地部署并实现公网远程访问
导航页配置服务Dashy本地部署并实现公网远程访问
|
7月前
|
安全 网络安全 网络虚拟化
企业路由器配置PPTP PC到站点模式VPN指南(外网访问内网资源)
企业路由器配置PPTP PC到站点模式VPN指南(外网访问内网资源)
193 0
|
7月前
|
应用服务中间件
阿里云的WAF(Web应用防火墙)3.0的虚拟代理
阿里云的WAF(Web应用防火墙)3.0的虚拟代理
112 2
宝塔面板使用同一个IP不同端口创建不同的网站,解决:“您添加的站点已存在”的问题
宝塔默认是不支持同一个IP创建不同网站的,所以我们想要再以这个IP+8000端口再搭建一个新网站,这个时候如果你像下面这样填写是错误的。会报错“您添加的站点已存在”
1326 0
宝塔面板使用同一个IP不同端口创建不同的网站,解决:“您添加的站点已存在”的问题
|
存储 网络安全 数据安全/隐私保护
在远程桌面服务中配置RD网关直接访问内网
原文地址:http://wangchunhai.blog.51cto.com/225186/1139388/ 远程桌面网关(RD 网关)是一项角色服务,使授权远程用户可以从任何连接到 Internet 并且可以运行远程桌面连接 (RDC) 客户端的设备连接到内部企业网络或专用网络上的资源。
4518 0
|
网络安全 Windows
IIS多站点共享端口
如何支持多站点共用一个SSL端口
801 0
|
Web App开发 测试技术 网络安全
专有网络VPC搭建FTP站点
很多windows服务器,在专有网络VPC内搭建FTP后,无法连接。自己搭建测试了下,并把步骤记录下来。
2612 0
|
存储 数据安全/隐私保护 定位技术