侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

Ipsec的配置的实现

2023-04-21 星期五 / 0 评论 / 0 点赞 / 71 阅读 / 4549 字

实现***的另一种协议是ipsec ,准确的说ipsec是一个多种协议组合的框架。它的实现可以分为下面四个步骤: 1. 实现数据流的筛选控制(靠acl实现控制) 2. 安全提议(实现工作模式,安全

.

实现***的另一种协议是ipsec ,准确的说ipsec是一个多种协议组合的框架。它的实现可以分为下面四个步骤:

1. 实现数据流的筛选控制(靠acl实现控制)

2. 安全提议(实现工作模式,安全协议的选择,验证算法,若为esp协议则还要有加密算法的一致性选择)

3. 创建安全策略(acl+安全提议+ike邻居),一般策略的实现都是选择自动协商的,所以要建立ike邻居

4. 策略应用到端口

下面是此次实验的拓扑图(sw 为防火墙 isp 为交换机):

下面为isp上的一些配置:

[Quidway]sysname isp

[isp]int vlan 10

[isp-vlan10]port Ethernet 0/2

[isp-vlan10]vlan 20

[isp-vlan20]port Ethernet 0/10

[isp-vlan20]vlan 30

[isp-vlan30]port Ethernet 0/3

[isp-vlan30]vlan 40

[isp-vlan40]port Ethernet 0/20

[isp-vlan40]qu

[isp]int Vlan-interface 10

[isp-Vlan-interface10]ip add 61.130.132.2 255.255.255.252

[isp-Vlan-interface10]qu

[isp]int vlan 20

[isp-Vlan-interface20]ip add 61.130.134.2 255.255.255.252

[isp-Vlan-interface20]qu

[isp]int vlan 30

[isp-Vlan-interface30]ip add 61.130.133.2 255.255.255.252

[isp-Vlan-interface30]qu

[isp]int vlan 40

[isp-Vlan-interface40]ip add 61.130.135.2 255.255.255.252

Sw1上的一些配置:

[H3C]sysname sw1

[sw1]int eth0/0

[sw1-Ethernet0/0]ip add 192.168.1.254 24

[sw1-Ethernet0/0]int eth0/3

[sw1-Ethernet0/3]ip add 61.130.132.1 30

[sw1-Ethernet0/3]int eth 0/4

[sw1-Ethernet0/4]ip add 61.130.133.1 30

[sw1-Ethernet0/4]qu

[sw1]firewall zone trust

[sw1-zone-trust]add interface e0/0

[sw1-zone-trust]qu

[sw1]firewall zone untrust

[sw1-zone-untrust]add int e0/3    

[sw1-zone-untrust]add int e0/4

Sw3上的一些配置:

[H3C]sysname sw3

[sw3]int e0/4

[sw3-Ethernet0/4]ip add 61.130.135.1 255.255.255.252

[sw3-Ethernet0/4]int eth0/0

[sw3-Ethernet0/0]ip add 192.168.3.254 255.255.255.0

[sw3-Ethernet0/0]loopback

[sw3-Ethernet0/0]qu

[sw3]firewall zone untrust

[sw3-zone-untrust]add int e0/4

[sw3]ip route 0.0.0.0 0 61.130.135.2

Sw2上的一些配置:

[H3C]sysname sw2

[sw2]int e0/4

[sw2-Ethernet0/4]ip add 61.130.134.1 255.255.255.252

[sw2-Ethernet0/4]int e0/0

[sw2-Ethernet0/0]ip add 192.168.2.254 255.255.255.0

[sw2-Ethernet0/0]loopback

[sw2-Ethernet0/0]qu

[sw2]firewall zone untrust

[sw2-zone-untrust]add int e0/4

[sw2]ip route 0.0.0.0 0 61.130.134.2

在sw1上实现ipsec 的配置:

// 利用acl实现流筛选

[sw1]acl number 3000 match-order auto

[sw1-acl-adv-3000]rule 10 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255

[sw1-acl-adv-3000]rule 20 deny ip source any destination any

[sw1-acl-adv-3000]qu

// 制作安全提议

[sw1]ipsec proposal tran3

[sw1-ipsec-proposal-tran3]encapsulation-mode tunnel

[sw1-ipsec-proposal-tran3]transform esp

[sw1-ipsec-proposal-tran3]esp authentication-algorithm md5

[sw1-ipsec-proposal-tran3]esp en des

[sw1-ipsec-proposal-tran3]quit

// 配置ike邻居

[sw1]  ike peer fw3

[sw1-ike-peer-fw3]pre-shared-key simple 12345

[sw1-ike-peer-fw3]local-address 61.130.132.1

[sw1-ike-peer-fw3]remote-address 61.130.134.1

[sw1-ike-peer-fw3]qu

// 配置策略

[sw1]ipsec policy policy3 10 isakmp

[sw1-ipsec-policy-isakmp-policy3-10]security acl 3000

[sw1-ipsec-policy-isakmp-policy3-10]proposal tran3

[sw1-ipsec-policy-isakmp-policy3-10]ike-peer fw3

[sw1-ipsec-policy-isakmp-policy3-10]qu

// 应用到接口

[sw1]int eth0/3

[sw1-Ethernet0/3]ipsec policy policy3

[sw1-Ethernet0/3]qu

同样,在sw2和sw3上做同样的设置即可,要注意提议与ike pre-shared-key的一致性

结果如下:

.

广告 广告

评论区