H3C 多分支机构动态IP使用IPSEC OVER GRE接入总部案例


总部使用ipsec 模板和分支机构(使用DHCP获取的动态IP),建立IPSEC OVER GRE 跑动态路由协议的配置举例
这个案例中的分支机构,由于是动态获取的IP所以分支和总部的IPSEC PROFILE中,并没有指定分支的IP地址;也没有在总部的IPSEC PROFILE中调用感兴趣流,因为无法分支机构的IP地址未知;
将隧道接口宣告进动态路由进程,不能将loopback地址宣告进路由进程,否则会造成查表自环
隧道口的源目IP地址是loopback接口;IPSEC-PROFILE 使用的是公网IP;
ike profile 标识本地和对端使用FQDN,因为对端是动态IP,应该使用名称
ike proposal 如果不详细配置,将使用系统自带的算法
ike 应该使用野蛮模式,并且流量应该由分支先发起,建立连接。


总部配置:
创建TUN端口 13 14
#############创建lo端口###############
interface LoopBack0
ip address 192.168.255.1 255.255.255.255

##########创建TUN13 14###############
interface Tunnel13 mode gre
ip address 10.255.13.1 255.255.255.252
rip authentication-mode md5 rfc2082 cipher $c 3 3 3hSpVaGwkBzDZJqJvBlcXxct65PghuiFCxw== 1
source LoopBack0
destination 192.168.255.3
keepalive 3 3

interface Tunnel14 mode gre
ip address 10.255.14.1 255.255.255.252
rip authentication-mode md5 rfc2082 cipher $c 3 3 3hSpVaGwkBzDZJqJvBlcXxct65PghuiFCxw== 1
source LoopBack0
destination 192.168.255.4
keepalive 3 3
############创建IPSEC 转换集#############
ipsec transform-set tr3
esp encryption-algorithm des-cbc
esp authentication-algorithm md5

ipsec transform-set tr4
esp encryption-algorithm des-cbc
esp authentication-algorithm md5
###########创建IPSEC 模板,调用IPSEC转换集,指定本端IP,调用IKE PROFILE#############
ipsec policy-template H3C 1
transform-set tr3
local-address 100.1.1.1
ike-profile p3

ipsec policy-template H3C 2
transform-set tr4
local-address 100.1.1.1
ike-profile p4
##########创建IPSEC PROFILE调用模板#################
ipsec policy H3C 1 isakmp template H3C
##########创建IKE PROFILE,指定共享密钥,本段地址标识,对端地址标识,IKE提议和模式为野蛮模式###########
ike profile p3
keychain r3
exchange-mode aggressive
local-identity fqdn r1
match remote identity fqdn r3
proposal 3

ike profile p4
keychain r4
exchange-mode aggressive
local-identity fqdn r1
match remote identity fqdn r4
proposal 4
#########创建IKE 提议##########################
ike proposal 3
#########创建IKE 密钥##########################
ike proposal 4

ike keychain r3
pre-shared-key hostname r3 key cipher $c$3$0e/ruiFjmfC/vLDw+lbNbtg6KTpR/g==

ike keychain r4
pre-shared-key hostname r4 key cipher $c 3 3 3Z+OkEco9WsY8zBtjSiBhjV0L0HmHTg==

##########最后在接口调用IPSEC POLICY############
interface GigabitEthernet0/2
port link-mode route
combo enable copper
ip address 100.1.1.1 255.255.255.0
nat outbound
ipsec apply policy H3C


分支机构
#########创建LO接口#############
interface LoopBack0
ip address 192.168.255.3 255.255.255.255

########创建TUN接口############
interface Tunnel13 mode gre
ip address 10.255.13.2 255.255.255.252
source LoopBack0
destination 192.168.255.1
keepalive 3 3

#########创建感兴趣流###########
acl advanced 3000
description IPsec
rule 0 permit gre source 192.168.255.3 0 destination 192.168.255.1 0

########创建IPSEC 转换集#########
ipsec transform-set tr1
esp encryption-algorithm des-cbc
esp authentication-algorithm md5
###创建IPSEC POLICY 调用转换集,调用IKE PROFILE 调用感兴趣流,指定对端IP地址#########
ipsec policy H3C 1 isakmp
transform-set tr1
security acl 3000
remote-address 100.1.1.1
ike-profile p1
##############创建IKE PROFILE############
ike profile p1
keychain r1
exchange-mode aggressive
local-identity fqdn r3
match remote identity fqdn r1
proposal 1
###########创建IKE 提议,使用默认算法#######
ike proposal 1
##########创建预共享密钥##################
ike keychain r1
pre-shared-key address 100.1.1.1 255.255.255.255 key cipher $c 3 3 3AMt8URlPq3dnqD0hihHfxQPrairsOw==

##########最后在接口掉用IPSEC PROFILE######
interface GigabitEthernet0/0
port link-mode route
combo enable copper
ip address dhcp-alloc
ipsec apply policy H3C


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值