https://support.huawei.com/enterprise/zh/doc/EDOC1100271739/3c66fb62
配置Efficient VPN采用Client模式建立IPSec隧道示例
组网需求
如图5-60所示,RouterA为企业远程小型分支网关,RouterB为企业总部网关,分支与总部通过公网建立通信,并且总部与分支的网络未做统一规划。分支子网为10.1.1.0/24,总部子网为10.1.2.0/24。DHCP Server为企业总部网关的DHCP服务器,为分支网关分配IP地址。
企业希望对分支子网与总部子网之间相互访问的流量进行安全保护,并且分支网关配置能够尽量简单,由总部网关对分支网关进行集中管理。分支与总部通过公网建立通信,并且总部与分支的网络未做统一规划,可以在分支网关与总部网关之间采用Efficient VPN Client模式建立一个IPSec隧道来实施安全保护,便于IPSec隧道的建立与维护管理。
Efficient VPN Client模式下,RouterA向RouterB申请IP地址用于建立IPSec隧道,同时申请DNS域名、DNS服务器地址和WINS服务器地址,提供给分支子网使用。
图5-60 配置Efficient VPN采用Client方式建立IPSec隧道组网图
配置思路
采用如下思路配置Efficient VPN采用Client模式建立IPSec隧道示例:
在RouterA和RouterB上配置接口的IP地址和到对端的静态路由,保证路由可达。
在RouterB上配置DHCP服务器地址,用于实现DHCP动态方式的地址分配。
RouterB作为IPSec隧道协商响应方,采用策略模板方式与RouterA建立IPSec隧道。
在RouterA上采用Client方式配置Efficient VPN,作为协商发起方与RouterB建立IPSec隧道。
操作步骤
分别在RouterA和RouterB上配置接口的IP地址和到对端的静态路由
# 在RouterA上配置接口的IP地址。
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 60.1.1.1 255.255.255.0 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ip address 10.1.1.1 255.255.255.0 [RouterA-GigabitEthernet2/0/0] quit
# 在RouterA上配置到对端的静态路由,此处假设到对端的下一跳地址为60.1.1.2。
[RouterA] ip route-static 60.1.2.0 255.255.255.0 60.1.1.2 [RouterA] ip route-static 10.1.2.0 255.255.255.0 60.1.1.2
# 在RouterB上配置接口的IP地址。其中接口GigabitEthernet4/0/0用作接收DHCP服务器分配的地址,该接口的IP地址必须与分配的IP地址在同一网段。
<Huawei> system-view [Huawei] sysname RouterB [RouterB] interface gigabitethernet 1/0/0 [RouterB-GigabitEthernet1/0/0] ip address 60.1.2.1 255.255.255.0 [RouterB-GigabitEthernet1/0/0] quit [RouterB] interface gigabitethernet 2/0/0 [RouterB-GigabitEthernet2/0/0] ip address 10.1.2.1 255.255.255.0 [RouterB-GigabitEthernet2/0/0] quit [RouterB] interface gigabitethernet 3/0/0 [RouterB-GigabitEthernet3/0/0] ip address 10.1.3.1 255.255.255.0 [RouterB-GigabitEthernet3/0/0] quit [RouterB] interface gigabitethernet 4/0/0 [RouterB-GigabitEthernet4/0/0] ip address 100.1.1.3 255.255.255.0 [RouterB-GigabitEthernet4/0/0] quit
# 在RouterB上配置到对端的静态路由,此处假设到对端的下一跳地址为60.1.2.2。
[RouterB] ip route-static 60.1.1.0 255.255.255.0 60.1.2.2 [RouterB] ip route-static 10.1.1.0 255.255.255.0 60.1.2.2 [RouterB] ip route-static 100.1.1.0 255.255.255.0 60.1.2.2
在RouterB上配置DHCP服务器地址,用于实现DHCP动态方式的地址分配
# 使能DHCP服务,创建DHCP服务器组并为服务器组添加DHCP服务器。
[RouterB] dhcp enable [RouterB] dhcp server group dhcp-ser1 [RouterB-dhcp-server-group-dhcp-ser1] dhcp-server 10.1.3.2 [RouterB-dhcp-server-group-dhcp-ser1] gateway 100.1.1.3 [RouterB-dhcp-server-group-dhcp-ser1] quit
RouterB作为IPSec隧道协商响应方,采用策略模板方式与RouterA建立IPSec隧道
# 通过AAA业务模板配置要推送的资源属性,推送IP地址、DNS域名、DNS服务器地址和WINS服务器地址。
[RouterB] aaa [RouterB-aaa] service-scheme schemetest [RouterB-aaa-service-schemetest] dhcp-server group dhcp-ser1 [RouterB-aaa-service-schemetest] dns-name mydomain.com.cn [RouterB-aaa-service-schemetest] dns 2.2.2.2 [RouterB-aaa-service-schemetest] dns 2.2.2.3 secondary [RouterB-aaa-service-schemetest] wins 3.3.3.2 [RouterB-aaa-service-schemetest] wins 3.3.3.3 secondary [RouterB-aaa-service-schemetest] quit [RouterB-aaa] quit
# 配置IKE安全提议和IKE对等体,并将AAA业务模板绑定在IKE对等体中。
[RouterB] ike proposal 5 [RouterB-ike-proposal-5] dh group14 [RouterB-ike-proposal-5] authentication-algorithm sha2-256 [RouterB-ike-proposal-5] encryption-algorithm aes-128 [RouterB-ike-proposal-5] quit [RouterB] ike peer rut3 [RouterB-ike-peer-rut3] version 1 [RouterB-ike-peer-rut3] undo version 2 [RouterB-ike-peer-rut3] exchange-mode aggressive [RouterB-ike-peer-rut3] pre-shared-key cipher YsHsjx_202206 [RouterB-ike-peer-rut3] ike-proposal 5 [RouterB-ike-peer-rut3] service-scheme schemetest [RouterB-ike-peer-rut3] quit
# 配置IPSec安全提议、策略模板方式的安全策略。
[RouterB] ipsec proposal prop1 [RouterB-ipsec-proposal-prop1] esp authentication-algorithm sha2-256 [RouterB-ipsec-proposal-prop1] esp encryption-algorithm aes-128 [RouterB-ipsec-proposal-prop1] quit [RouterB] ipsec policy-template temp1 10 [RouterB-ipsec-policy-templet-temp1-10] ike-peer rut3 [RouterB-ipsec-policy-templet-temp1-10] proposal prop1 [RouterB-ipsec-policy-templet-temp1-10] quit [RouterB] ipsec policy policy1 10 isakmp template temp1
# 开启SHA-2算法兼容RFC标准算法功能。
[RouterB] ipsec authentication sha2 compatible enable
# 在接口上应用安全策略组。
[RouterB] interface gigabitethernet 1/0/0 [RouterB-GigabitEthernet1/0/0] ipsec policy policy1 [RouterB-GigabitEthernet1/0/0] quit
在RouterA上采用Client方式配置Efficient VPN,建立IPSec隧道。
# 配置Efficient VPN的模式为Client模式,并在模式视图下指定IKE协商时的对端地址和预共享密钥。
[RouterA] ipsec efficient-vpn evpn mode client [RouterA-ipsec-efficient-vpn-evpn] remote-address 60.1.2.1 v1 [RouterA-ipsec-efficient-vpn-evpn] pre-shared-key cipher YsHsjx_202206 [RouterA-ipsec-efficient-vpn-evpn] dh group14 [RouterA-ipsec-efficient-vpn-evpn] quit
# 在接口上应用Efficient VPN。
[RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ipsec efficient-vpn evpn [RouterA-GigabitEthernet1/0/0] quit
检查配置结果
# 配置成功后,在主机PC A上执行ping操作仍然可以ping通主机PC B,执行命令display ipsec statistics可以查看数据包的统计信息。
# 在RouterA上执行display ike sa操作,结果如下。
[RouterA] display ike sa IKE SA information : Conn-ID Peer VPN Flag(s) Phase RemoteType RemoteID ----------------------------------------------------------------------------- 26 60.1.2.1:500 RD|ST v1:2 IP 60.1.2.1 25 60.1.2.1:500 RD|ST v1:1 IP 60.1.2.1 Number of IKE SA : 2 ----------------------------------------------------------------------------- Flag Description: RD--READY ST--STAYALIVE RL--REPLACED FD--FADING TO--TIMEOUT HRT--HEARTBEAT LKG--LAST KNOWN GOOD SEQ NO. BCK--BACKED UP M--ACTIVE S--STANDBY A--ALONE NEG--NEGOTIATING
配置文件
RouterA的配置文件
# sysname RouterA # ipsec efficient-vpn evpn mode client remote-address 60.1.2.1 v1 pre-shared-key cipher %^%#JvZxR2g8c;a9~FPN~n'$7`DEV&=G(=Et02P/%\*!%^%# dh group14 # interface GigabitEthernet1/0/0 ip address 60.1.1.1 255.255.255.0 ipsec efficient-vpn evpn # interface GigabitEthernet2/0/0 ip address 10.1.1.1 255.255.255.0 # ip route-static 60.1.2.0 255.255.255.0 60.1.1.2 ip route-static 10.1.2.0 255.255.255.0 60.1.1.2 # return
RouterB的配置文件
# sysname RouterB # ipsec authentication sha2 compatible enable # dhcp enable # ipsec proposal prop1 esp authentication-algorithm sha2-256 esp encryption-algorithm aes-128 # ike proposal 5 encryption-algorithm aes-128 dh group14 authentication-algorithm sha2-256 authentication-method pre-share integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer rut3 version 1 exchange-mode aggressive pre-shared-key cipher %^%#K{JG:rWVHPMnf;5\|,GW(Luq'qi8BT4nOj%5W5=)%^%# ike-proposal 5 service-scheme schemetest # ipsec policy-template temp1 10 ike-peer rut3 proposal prop1 # ipsec policy policy1 10 isakmp template temp1 # dhcp server group dhcp-ser1 dhcp-server 10.1.3.2 0 gateway 100.1.1.3 # aaa service-scheme schemetest dns 2.2.2.2 dns 2.2.2.3 secondary dhcp-server group dhcp-ser1 wins 3.3.3.2 wins 3.3.3.3 secondary dns-name mydomain.com.cn # interface GigabitEthernet1/0/0 ip address 60.1.2.1 255.255.255.0 ipsec policy policy1 # interface GigabitEthernet2/0/0 ip address 10.1.2.1 255.255.255.0 # interface GigabitEthernet3/0/0 ip address 10.1.3.1 255.255.255.0 # interface GigabitEthernet4/0/0 ip address 100.1.1.3 255.255.255.0 # ip route-static 60.1.1.0 255.255.255.0 60.1.2.2 ip route-static 10.1.1.0 255.255.255.0 60.1.2.2 ip route-static 100.1.1.0 255.255.255.0 60.1.2.2 # return
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/4682.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~