当前位置:网站首页>华为路由器:ipsec技术
华为路由器:ipsec技术
2022-06-24 07:07:00 【兔子王cool】
实验拓扑
R1 按照拓扑配置好IP地址
这里省略。
R2配置
[R2]ip route-static 0.0.0.0 0 10.10.10.2 #加一条路由,使得两个公网IP互通
[R2]acl 3000
[R2-acl-adv-3000]rule permit ip source 192.168.11.0 0.0.0.255 destination 192.16
8.12.0 0.0.0.255
创建ipsec的安全提议
[R2]ipsec proposal pokes
[R2-ipsec-proposal-pokes]q
[R2]dis ipsec proposal name pokes #先查看一下
IPSec proposal name: pokes
Encapsulation mode: Tunnel #封装方式
Transform : esp-new #传输级
ESP protocol : Authentication MD5-HMAC-96 #认证算法
Encryption DES #加密算法
创建安全策略
[R2]ipse
[R2]ipsec policy zhpr 10 manual #创建手动安全策略zhpr 10
[R2-ipsec-policy-manual-zhpr-10]security acl 3000 #调用acl
[R2-ipsec-policy-manual-zhpr-10]proposal pokes #调用安全提议
[R2-ipsec-policy-manual-zhpr-10]tunnel local 10.10.10.1 #指定隧道源地址
[R2-ipsec-policy-manual-zhpr-10]tunnel remote 10.10.20.1 #指定隧道目标地址
[R2-ipsec-policy-manual-zhpr-10]sa spi inbound esp 123456 #设置安全联盟的安全索引SPI
[R2-ipsec-policy-manual-zhpr-10]sa string-key inbound esp simple 234567 #设置安全联盟的认证密钥
[R2-ipsec-policy-manual-zhpr-10]sa spi outbound esp 123456
[R2-ipsec-policy-manual-zhpr-10]sa string-key outbound esp simple 234567
接口下调用policy策略
[R2]in g0/0/0 #公网出口
[R2-GigabitEthernet0/0/0]ipsec policy zhpr
[R2]dis ipsec policy brief #查看ipsec接口信息
Number of policies group : 1
Number of policies : 1
Policy name Mode ACL Peer name Local address Remote address
--------------------------------------------------------------------------------
zhpr-10 manual 3000 10.10.10.1 10.10.20.1
[R2]
注意事项:
sa spi inbound esp 123456
要和对端的outbound保持一致。sa string-key inbound esp simple 234567
要和对端的outbound保持一致。
建议配置好一端之后复制粘贴,粘贴时改掉源地址和目标地址。
R3配置
[R3]ip route-static 0.0.0.0 0 10.10.20.2
[R3]acl 3000
[R3-acl-adv-3000]rule permit ip source 192.168.12.0 0.0.0.255 destination 192.16
8.11.0 0.0.0.255
[R2]ipse
[R2]ipsec policy zhpr 10 manual
[R3-ipsec-policy-manual-zhpr-10] security acl 3000
[R3-ipsec-policy-manual-zhpr-10] proposal pokes
[R3-ipsec-policy-manual-zhpr-10] tunnel local 10.10.20.1
[R3-ipsec-policy-manual-zhpr-10] tunnel remote 10.10.10.1
[R3-ipsec-policy-manual-zhpr-10] sa spi inbound esp 123456
[R3-ipsec-policy-manual-zhpr-10] sa string-key inbound esp simple 234567
[R3-ipsec-policy-manual-zhpr-10] sa spi outbound esp 123456
[R3-ipsec-policy-manual-zhpr-10] sa string-key outbound esp simple 234567
[R3-ipsec-policy-manual-zhpr-10]q
[R3]in g0/0/0
[R3-GigabitEthernet0/0/0]ips
[R3-GigabitEthernet0/0/0]ipsec po
[R3-GigabitEthernet0/0/0]ipsec policy zhpr
[R3]dis ipsec policy brief
Number of policies group : 1
Number of policies : 1
Policy name Mode ACL Peer name Local address Remote address
--------------------------------------------------------------------------------
zhpr-10 manual 3000 10.10.20.1 10.10.10.1
测试结果
PC>ping 192.168.12.1
Ping 192.168.12.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.12.1: bytes=32 seq=2 ttl=127 time=15 ms
From 192.168.12.1: bytes=32 seq=3 ttl=127 time=16 ms
From 192.168.12.1: bytes=32 seq=4 ttl=127 time=31 ms
From 192.168.12.1: bytes=32 seq=5 ttl=127 time=16 ms
--- 192.168.12.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/19/31 ms
PC>
PC>ping 192.168.11.1
Ping 192.168.11.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.11.1: bytes=32 seq=2 ttl=127 time=16 ms
From 192.168.11.1: bytes=32 seq=3 ttl=127 time=15 ms
From 192.168.11.1: bytes=32 seq=4 ttl=127 time=32 ms
From 192.168.11.1: bytes=32 seq=5 ttl=127 time=31 ms
--- 192.168.11.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/23/32 ms
PC>
其实生成过程中,搭建ipset都是购买硬件设备来实现,而且功能强大,用路由器做实属有点low.
边栏推荐
猜你喜欢
[MySQL from introduction to mastery] [advanced part] (I) character set modification and underlying principle
Xiaohei ai4code code baseline nibble 1
MySQL | 视图《康师傅MySQL从入门到高级》笔记
Database migration from PostgreSQL to MySQL
【LeetCode】541. 反转字符串 II
从华为WeAutomate数字机器人论坛,看政企领域的“政务新智理”
Jenkins is deployed automatically and cannot connect to the dependent service [solved]
It is enough to read this article about ETL. Three minutes will let you understand what ETL is
玄铁E906移植----番外0:玄铁C906仿真环境搭建
pymysql 向MySQL 插入数据无故报错
随机推荐
Using skills of xargs -- the way to build a dream
【LeetCode】415. 字符串相加
Scheduled database backup script
520. 检测大写字母
什么是SRE?一文详解SRE运维体系
[10 day SQL introduction] Day2
开源之夏中选名单已公示,基础软件领域成为今年的热门申请
Win11 blank when using VIM to view content in cmder
leetcode 1642. Furthest building you can reach
【Pytorch基础教程31】YoutubeDNN模型解析
快慢指针系列
liunx服务器 telnet 带用户名 端口登陆方法
【LeetCode】541. 反转字符串 II
How does the tunnel mobile inspection track robot monitor 24 hours to ensure the safety of tunnel construction?
偶然间得到的framework工具类 自用
数据中台:中台实践与总结
Database migration from PostgreSQL to MySQL
input的聚焦后的边框问题
Xiaohei ai4code code baseline nibble 1
Change SSH port number