锐捷配置IPSEC VPN静态隧道

1、实验拓扑


2、实验目的


  1. 学习使用IPSEC VPN静态隧道,掌握IPSEC VPN静态隧道配置

3、实验配置


第一步:配置接口地址和静态路由使得R1、R2能够ping通

R1

Ruijie >enable

Ruijie #configure terminal

Ruijie(config)#interface gigabitEthernet 0/0

Ruijie(config-if-GigabitEthernet 0/0)#ip address 192.168.3.1 24

Ruijie(config-if-GigabitEthernet 0/0)#exit

Ruijie(config)#interface gigabitEthernet 0/1

Ruijie(config-if-GigabitEthernet 0/1)#ip address 192.168.1.1 24

Ruijie(config-if-GigabitEthernet 0/1)#exit

Ruijie(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2

R2

Ruijie >enable

Ruijie #configure terminal

Ruijie(config)#interface gigabitEthernet 0/0

Ruijie(config-if-GigabitEthernet 0/0)#ip address 192.168.3.2 24

Ruijie(config-if-GigabitEthernet 0/0)#exit

Ruijie(config)#interface gigabitEthernet 0/1

Ruijie(config-if-GigabitEthernet 0/1)#ip address 192.168.2.1 24

Ruijie(config-if-GigabitEthernet 0/1)#exit

Ruijie(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1

第二步:配置静态IPSEC VPN隧道

R1

1、配置ipsec感兴趣流

Ruijie(config)# access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255     //指定感兴趣流为源地址192.168.1.0/24,目的地址为192.168.2.0/24的网段。

2、配置isakmp策略

Ruijie(config)#crypto isakmp keepalive 5 periodic      //配置IPSEC DPD探测功能

Ruijie(config)#crypto isakmp policy 1                 //创建新的isakmp策略

Ruijie(isakmp-policy)#authentication pre-share       //指定认证方式为预共享密码

Ruijie(isakmp-policy)#encryption 3des                //指定使用3DES进行加密

Ruijie(isakmp-policy)#exit

3、配置预共享密钥

Ruijie(config)#crypto isakmp key 0 ruijie address 192.168.3.2    //指定peer 192.168.3.2的预共享密钥为ruijie对端也必须配置一致的密钥

4、配置ipsec加密转换集

Ruijie(config)#crypto ipsec transform-set myset  esp-des esp-md5-hmac   //指定ipsec使用esp封装des加密、MD5检验

Ruijie(cfg-crypto-trans)#exit

5、配置ipsec加密图

Ruijie(config)#crypto map mymap 5 ipsec-isakmp              //新建名称为mymap的加密图

Ruijie(config-crypto-map)#set peer 192.168.3.2              //指定peer地址

Ruijie(config-crypto-map)#set transform-set myset           //指定加密转换集myset

Ruijie(config-crypto-map)#match address 101                //指定感兴趣流为ACL 101

Ruijie(config-crypto-map)#exit

6、将加密图应用到接口

Ruijie(config)#interface gigabitEthernet 0/0

Ruijie(config-if-GigabitEthernet 0/0)#crypto map mymap

R2

1、配置ipsec感兴趣流

Ruijie(config)# access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255

2、配置isakmp策略

Ruijie(config)#crypto isakmp keepalive 5 periodic

Ruijie(config)#crypto isakmp policy 1

Ruijie(isakmp-policy)#authentication pre-share

Ruijie(isakmp-policy)#encryption 3des

Ruijie(isakmp-policy)#exit

3、配置预共享密钥

Ruijie(config)#crypto isakmp key 0 ruijie address 192.168.3.1

4、配置ipsec加密转换集

Ruijie(config)#crypto ipsec transform-set myset  esp-des esp-md5-hmac

Ruijie(cfg-crypto-trans)#exit

5、配置ipsec加密图

Ruijie(config)#crypto map mymap 5 ipsec-isakmp

Ruijie(config-crypto-map)#set peer 192.168.3.1

Ruijie(config-crypto-map)#set transform-set myset

Ruijie(config-crypto-map)#match address 101

Ruijie(config-crypto-map)#exit

6、将加密图应用到接口

Ruijie(config)#interface gigabitEthernet 0/0

Ruijie(config-if-GigabitEthernet 0/0)#crypto map mymap

4、实验验证


1、在R1上使用源ip:192.168.1.1 ping R2的ip:192.168.2.1

2、在R1上查看isakmp、ipsec sa是否已经协商成功

3、在R1上查看ipsec sa 协商情况

目 录 第一章:设备配置和文件管理...............4 1.1 通过TELNET方式来配置设备............4 1.2 更改IOS命令的特权等级...............4 1.3 设备时钟设置.......................5 第二章:交换机基础配置..................5 2.1 交换机vlan和trunk的配置............5 2.2 turnk接口修剪配置..................6 2.3 PVLAN配置.........................7 2.4 端口汇聚配置.......................8 2.5 生成树配置.........................9 2.6 端口镜像配置.......................9 第三章:交换机防止ARP欺骗配置............10 3.1 交换机地址绑定(address-bind)功能.....10 3.2 交换机端口安全功能...................10 3.3 交换机arp-check功能.................11 3.4 交换机ARP动态检测功能(DAI) ..........11 第四章:访问控制列表配置(ACL)............12 4.1 标准ACL配置.........................12 4.2 扩展ACL配置........................13 4.3 VLAN之间的ACL配置..................13 4.4 单向ACL的配置......................15 第五章:应用协议配置....................16 5.1 DHCP服务配置.......................16 5.2 交换机dot1x认证配置................18 5.3 QOS限速配置.......................19 5.4 IPsec配置........................20 5.5 GRE配置..................22 5.6 PPTP配置......................22 5.7 路由器L2TP配置................23 5.8 路由器NAT配置.................24 第六章:路由协议配置..............25 6.1 默认路由配置...................25 6.2 静态路由配置..................25 6.3 浮动路由配置..................25 6.4 策略路由配置..................25 6.5 OSPF配置......................26 6.6 OSPF中router ID配置..........27
以下是锐捷设备IPsec VPN的常用配置指令: 1. 创建IPsec策略 ``` ipsec policy add <name> <action> <src> <dst> <proto> <s_port> <d_port> <crypt> <auth> <pfs> ``` 具体参数说明: - `<name>`:IPsec策略名称,自定义命名。 - `<action>`:数据包处理方式,可选参数为`encrypt`、`decrypt`、`ipsec`、`clear`。 - `<src>`:源地址,可以是单个IP地址、网段或者`any`。 - `<dst>`:目的地址,可以是单个IP地址、网段或者`any`。 - `<proto>`:协议类型,可选参数为`ah`、`esp`、`ipcomp`。 - `<s_port>`:源端口,可选参数为`any`或者具体的端口号。 - `<d_port>`:目的端口,可选参数为`any`或者具体的端口号。 - `<crypt>`:加密算法,可选参数为`des`、`3des`、`aes128`、`aes192`、`aes256`。 - `<auth>`:认证算法,可选参数为`hmac-md5`、`hmac-sha1`、`hmac-sha2-256`、`hmac-sha2-384`、`hmac-sha2-512`。 - `<pfs>`:PFS(Perfect Forward Secrecy)算法,可选参数为`group1`、`group2`、`group5`、`group14`、`group19`、`group20`。 例如,创建一个名为`myipsec`的IPsec策略,源地址为`10.0.0.0/24`,目的地址为`192.168.0.0/24`,协议类型为`esp`,加密算法为`aes256`,认证算法为`hmac-sha2-512`,PFS算法为`group5`,数据包处理方式为`encrypt`,则指令为: ``` ipsec policy add myipsec encrypt 10.0.0.0/24 192.168.0.0/24 esp any any aes256 hmac-sha2-512 group5 ``` 2. 配置IPsec连接 ``` ipsec peer add <name> <addr> <auth> <crypt> <pfs> <local> <remote> <mode> ``` 具体参数说明: - `<name>`:IPsec连接名称,自定义命名。 - `<addr>`:远程IP地址。 - `<auth>`:认证算法,可选参数为`hmac-md5`、`hmac-sha1`、`hmac-sha2-256`、`hmac-sha2-384`、`hmac-sha2-512`。 - `<crypt>`:加密算法,可选参数为`des`、`3des`、`aes128`、`aes192`、`aes256`。 - `<pfs>`:PFS(Perfect Forward Secrecy)算法,可选参数为`group1`、`group2`、`group5`、`group14`、`group19`、`group20`。 - `<local>`:本地IP地址。 - `<remote>`:远程IP地址。 - `<mode>`:模式,可选参数为`main`(主模式)或`aggressive`(快速模式)。 例如,创建一个名为`myvpn`的IPsec连接,本地IP地址为`192.168.1.1`,远程IP地址为`10.0.0.1`,认证算法为`hmac-sha1`,加密算法为`aes128`,PFS算法为`group2`,模式为`main`,则指令为: ``` ipsec peer add myvpn 10.0.0.1 hmac-sha1 aes128 group2 192.168.1.1 10.0.0.1 main ``` 以上是锐捷设备IPsec VPN的常用配置指令,具体使用时还需根据实际需求进行调整。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值