千家信息网

ipsec的搭建

发表于:2025-12-01 作者:千家信息网编辑
千家信息网最后更新 2025年12月01日,ipsec简介IPSec(InternetProtocolSecurity)是安全联网的长期方向。它通过端对端的安全性来提供主动的保护以防止专用网络与 Internet 的***。在通信中,只有发送方
千家信息网最后更新 2025年12月01日ipsec的搭建

ipsec简介

IPSec(InternetProtocolSecurity)是安全联网的长期方向。它通过端对端的安全性来提供主动的保护以防止专用网络与 Internet 的***。在通信中,只有发送方和接收方才是唯一必须了解 IPSec 保护的计算机。在 Windows 2000、Windows XP 和 Windows Server 2003 家族中,IPSec 提供了一种能力,以保护工作组、局域网计算机、域客户端和服务器、分支机构(物理上为远程机构)、Extranet 以及漫游客户端之间的通信。

下面我们就用一台三层交换机和三台防火墙来模拟一下ipsec

拓扑图

设置三层交换机

sys

[Quidway]sys isp

[isp]vlan 10

[isp-vlan10]port e0/1

[isp-vlan10]vlan 20

[isp-vlan20]port e0/9

[isp-vlan20]vlan 30

[isp-vlan30]port e0/17

[isp-vlan30]int vlan10

[isp-Vlan-interface10]ip add 67.130.130.1 255.255.255.252

[isp-Vlan-interface10]int vlan 20

[isp-Vlan-interface20]ip add 67.130.130.5 255.255.255.252

[isp-Vlan-interface20]int vlan 30

[isp-Vlan-interface30]ip add 67.130.130.9 255.255.255.252




设置fw1

sys

[H3C]sys fw1

[fw1]int eth0/0

[fw1-Ethernet0/0]ip add 192.168.3.1 24

[fw1-Ethernet0/0]loopback

[fw1-Ethernet0/0]int eth0/4

[fw1-Ethernet0/4]ip add 67.130.130.2 30

取消端口隔离

[fw1]undo insulate

添加eth0/4到untrust

[fw1]firewall zone untrust

[fw1-zone-untrust]add int eth0/4

添加eth0/0到trust

[fw1]firewall zone trust

[fw1-zone-trust]add int eth0/0

用访问控制列表筛选

[fw1]acl number 3000 match-order auto

[fw1-acl-adv-3000]rule 10 permit ip source 192.168.3.0 0.0.0.255 destination 192.168.4.0 0.0.0.255

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

创建安全提议tran1

[fw1]ipsec proposal tran1

选择管道方式

[fw1-ipsec-proposal-tran1]encapsulation-mode tunnel

选择安全协议sep

[fw1-ipsec-proposal-tran1]transform esp

完整性校验选md5

[fw1-ipsec-proposal-tran1]esp authentication-algorithm md5

加密算法选des

[fw1-ipsec-proposal-tran1]esp encryption-algorithm des

设置ike peer

[fw1]ike peer fw2

设置来源ip

[fw1-ike-peer-fw2]local-address 67.130.130.2

设置目标ip

[fw1-ike-peer-fw2]remote-address 67.130.130.6

设置密钥

[fw1-ike-peer-fw2]pre-shared-key 123456

注意,这个密钥一定要记住,下面还要用到


isa和筛选流相结合


选择动态isa

[fw1]ipsec policy policy1 10 isakmp

筛选符合3000表的流

[fw1-ipsec-policy-isakmp-policy1-10]security acl 3000

选择符合提议tran1的

[fw1-ipsec-policy-isakmp-policy1-10]proposal tran1

选择ike 对等体为fw2

[fw1-ipsec-policy-isakmp-policy1-10]ike-peer fw2

进入端口eth0/4应用策略

[fw1]int eth0/4

[fw1-Ethernet0/4]ipsec policy policy1

第一条隧道已经设置好了,接着该去设置这条隧道的另一端,进入防火墙fw2

下面是第二条隧道的设置

[fw1]acl number 3001 match-order auto

[fw1-acl-adv-3001]rule permit ip source 192.168.3.0 0.0.0.255 destination 192.168.5.0 0.0.0.255

[fw1-acl-adv-3001]rule deny ip source any destination any

[fw1]ipsec proposal tran2

[fw1-ipsec-proposal-tran2]encapsulation-mode tunnel

[fw1-ipsec-proposal-tran2]transform esp

[fw1-ipsec-proposal-tran2]esp authentication-algorithm md5

[fw1-ipsec-proposal-tran2]esp encryption-algorithm des

[fw1]ike peer fw3

[fw1-ike-peer-fw3]local-address 67.130.130.2

[fw1-ike-peer-fw3]remote-address 67.130.130.10

[fw1-ike-peer-fw3]pre-shared-key 654321

[fw1]acl number 3001 match-order auto

[fw1-acl-adv-3000]undo rule 20


设置fw2


sys

[H3C]sys fw2

[fw2]int eth0/0

[fw2-Ethernet0/0]ip add 192.168.4.1 24

[fw2-Ethernet0/0]loopback

[fw2-Ethernet0/0]int eth0/4

[fw2-Ethernet0/4]ip add 67.130.130.6 30

[fw2]undo insulate

[fw2]firewall packet-filter default permit

[fw2]firewall zone trust

[fw2-zone-trust]add interface eth0/0

[fw2]firewall zone untrust

[fw2-zone-untrust]add int eth0/4

[fw2]ip route-static 0.0.0.0 0 67.130.130.5

[fw2]acl number 3000 match-order auto

[fw2-acl-adv-3000]rule 10 permit ip source 192.168.4.0 0.0.0.255 destination 192.168.3.0 0.0.0.255

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

[fw2]ipsec proposal tran1

[fw2-ipsec-proposal-tran1]encapsulation-mode tunnel

[fw2-ipsec-proposal-tran1]esp authentication-algorithm md5

[fw2-ipsec-proposal-tran1]esp encryption-algorithm des

[fw2]ike peer fw1

[fw2-ike-peer-fw1]local-address 67.130.130.6

[fw2-ike-peer-fw1]remote-address 67.130.130.2

[fw2-ike-peer-fw1]pre-shared-key 123456

这个密钥要和另外一端的一样

[fw2]ipsec policy policy1 10 isakmp

[fw2-ipsec-policy-isakmp-policy1-10]security acl 3000

[fw2-ipsec-policy-isakmp-policy1-10]proposal tran1

[fw2-ipsec-policy-isakmp-policy1-10]ike-peer fw1

[fw2]int eth0/4

[fw2-Ethernet0/4]ipsec policy policy1






配置fw3


sys

[H3C]sys fw3

[fw3]int eth0/0

[fw3-Ethernet0/0]ip add 192.168.5.1 24

[fw3-Ethernet0/0]loopback

[fw3-Ethernet0/0]int eth0/4

[fw3-Ethernet0/4]ip add 67.130.130.10 30

[fw3]undo insulate

[fw3]firewall zone untrust

[fw3-zone-untrust]add int eth0/4

[fw3]firewall zone trust

[fw3-zone-trust]add int eth0/0

[fw3]ip route-static 0.0.0.0 0 67.130.130.9

[fw3]acl number 3001 match-order auto

[fw3-acl-adv-3001]rule 10 permit ip source 192.168.5.0 0.0.0.255 destination 192.168.3.0 0.0.0.255

[fw3-acl-adv-3001]rule 20 deny ip source any destination any

[fw3]ipsec proposal tran2

[fw3-ipsec-proposal-tran2]encapsulation-mode tunnel

[fw3-ipsec-proposal-tran2]transform esp

[fw3-ipsec-proposal-tran2]esp authentication-algorithm md5

[fw3-ipsec-proposal-tran2]esp encryption-algorithm des

[fw3]ike peer fw1

[fw3-ike-peer-fw1]local-address 67.130.130.10

[fw3-ike-peer-fw1]remote-address 67.130.130.2

[fw3-ike-peer-fw1]pre-shared-key 654321

[fw3]ipsec policy policy1 10 isakmp

[fw3-ipsec-policy-isakmp-policy1-10]security acl 3001

[fw3-ipsec-policy-isakmp-policy1-10]tracert tran2

[fw3-ipsec-policy-isakmp-policy1-10]ike-peer fw1

[fw3]int eth0/4

[fw3-Ethernet0/4]ipsec policy policy1

好了ipsec


选择 安全 密钥 隧道 保护 交换机 客户 客户端 机构 端口 端的 计算机 防火墙 通信 防火 主动 一端 之间 分支 动态 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 网络安全试卷试卷1 村社区网络安全宣传 代理服务器创建 大话西游3经典服务器能转服吗 网络安全精英赛是什么级别 围绕网络安全法开展工作 网页服务器数据保存多长时间 拉萨东塔网络安全学院简单易学 软件开发设计和工程造价 根据网络安全法的规定市 北京服务器集群云空间 泰拉瑞亚服务器如何创 上海新能源网络技术试验设备 阿里高级软件开发工程师 安全风险数据库应包含的内容 闵行区品质网络技术采购信息 开源软件开发有前途吗 跨链接复制数据库 java数据库版本插件 这些网络安全知识您get了吗 数据库应用中必须有表吗 数据库只能建一个表 我市网络安全工作 韩国服务器评测 我的世界服务器打字卡顿 杰诺尔互联网科技有限公司 常用软件开发值得推荐 无人机软件开发公司有哪些 网络安全工具写生 网络安全等级保护2.0相关标准
0