路由器ipsec配置

实验拓扑:

 

要求:

pc1 pc2之间使用IPsec 通信

配置:

R1:

sysname r1

#
acl number 3000  
 rule 1 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
 
#
ipsec proposal yyy
 esp authentication-algorithm sha1
 esp encryption-algorithm 3des
#
ike proposal 1
 encryption-algorithm aes-cbc-128
 dh group5
 authentication-algorithm md5
 sa duration 3600
#
ike peer yyy v1
 pre-shared-key simple 123
 ike-proposal 1
 remote-address 200.1.1.1
#
ipsec policy yyy 1 isakmp
 security acl 3000
 ike-peer yyy
 proposal yyy
#

interface GigabitEthernet0/0/0
 ip address 192.168.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 100.1.1.1 255.255.255.0 
 ipsec policy yyy

#
ip route-static 0.0.0.0 0.0.0.0 100.1.1.2

r3:

#
 sysname r3

#
acl number 3000  
 rule 1 permit ip source 192.168.2.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
 
#
ipsec proposal yyy
 esp authentication-algorithm sha1
 esp encryption-algorithm 3des
#
ike proposal 1
 encryption-algorithm aes-cbc-128
 dh group5
 authentication-algorithm md5
 sa duration 3600
#
ike peer yyy v1
 pre-shared-key simple 123
 ike-proposal 1
 remote-address 100.1.1.1
#
ipsec policy yyy 1 isakmp
 security acl 3000
 ike-peer yyy
 proposal yyy

#
interface GigabitEthernet0/0/0
 ip address 200.1.1.1 255.255.255.0 
 ipsec policy yyy
#
interface GigabitEthernet0/0/1
 ip address 192.168.2.1 255.255.255.0 

#
ip route-static 0.0.0.0 0.0.0.0 200.1.1.2

实验结果:

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在华为路由器和H3C路由器之间配置GRE over IPsec(IP安全隧道协议)可以实现安全的跨网段通信。下面是一个简单的配置示例: 在华为路由器上的配置步骤: 1. 创建GRE隧道接口,并指定本地和远程IP地址: ``` interface Tunnel 0 ip address 192.168.1.1 255.255.255.0 tunnel-protocol gre source GigabitEthernet 0/0/0 destination 10.0.0.1 ``` 2. 创建IPsec策略,并指定加密算法、密钥等参数: ``` ipsec proposal myproposal esp authentication-algorithm md5 esp encryption-algorithm des ipsec policy mypolicy 10 isakmp security acl 3001 proposal myproposal acl number 3001 rule 5 permit gre source 192.168.1.0 0.0.0.255 destination 10.0.0.0 0.255.255.255 ike proposal myproposal authentication-method pre-share encryption-algorithm des integrity-algorithm md5 sa duration time-based 28800 ike-peer 10.0.0.1 pre-shared-key cipher %^%#zjhuawei%^%# ike-proposal myproposal ``` 在H3C路由器上的配置步骤: 1. 创建GRE隧道接口,并指定本地和远程IP地址: ``` interface Tunnel 0 ip address 192.168.1.2 255.255.255.0 tunnel-protocol gre source GigabitEthernet 0/0/0 destination 10.0.0.2 ``` 2. 创建IPsec策略,并指定加密算法、密钥等参数: ``` ipsec proposal myproposal esp authentication-algorithm md5 esp encryption-algorithm des ipsec policy mypolicy 10 isakmp security acl 3001 proposal myproposal acl number 3001 rule 5 permit gre source 192.168.1.0 0.0.0.255 destination 10.0.0.0 0.255.255.255 ike proposal myproposal authentication-method pre-share encryption-algorithm des integrity-algorithm md5 sa duration time-based 28800 ike-peer 10.0.0.2 pre-shared-key cipher %^%#h3c%^%# ike-proposal myproposal ``` 以上配置示例中,需要根据实际情况替换IP地址、接口名称、加密算法、密钥等参数。配置完成后,华为路由器和H3C路由器之间的GRE over IPsec隧道将建立起来,可以实现跨网络的安全通信。请注意,这只是一个简单的示例,实际配置可能会有所不同,取决于具体的设备型号和操作系统版本。建议参考设备的官方文档或咨询厂商获取更详细的配置指南。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值