防火墙在LTE IPSec解决方案中的应用
简介
本案例介绍了双机旁路部署模式下,IPSec特性在LTE中的应用场景和配置方法。
基于Eudemon200E-N&Eudemon1000E-N&Eudemon8000E-X V500R005C00版本写作,可供Eudemon200E-N&Eudemon1000E-N&Eudemon8000E-X V500R005C00、Eudemon200E-G&Eudemon1000E-G V600R006C00及后续版本参考。不同版本之间可能存在差异,请以实际版本为准。
方案简介
LTE简介
LTE(Long Term Evolution)是3GPP(Third Generation Partnership Project)组织于2004年12月为UMTS(Universal Mobile Telecommunications System)长期演进而启动的一个项目,该项目旨在增加移动通信系统的数据传输速率,减少网络节点和系统复杂度,从而降低网络部署和维护成本。从第一代(1G)移动通信系统采用模拟通信技术开始,在陆续经历了2G、3G的技术革新以后,现在的移动通信系统正逐步跨入4G时代,LTE正在成为4G网络的代名词。严格来讲,LTE项目所使用的技术并不完全满足国际电信联盟对4G的定义,所以只能算作准4G,但这并没有影响运营商将LTE定位为4G网络的主流标准。
LTE的网络架构
LTE的网络架构较之于3G网络更扁平化和IP化,其架构如图1-1所示。
LTE网络整体由以下几部分组成:
- UE(User Equipment):泛指LTE网络中用户使用的移动终端,例如手机、智能终端、多媒体设备等。
- eNodeB(Evolved NodeB):eNodeB即通常讲的无线基站,其作用是为用户提供无线接入服务。
- IP-RAN(Radio Access Network):IP化的无线接入网络,属于LTE网络中的接入网部分。
- EPC(Evolved Packet Core):进化型的分组核心,可以理解为LTE网络的核心网部分。
- MME(Mobility Management Entity):移动性管理实体,主要负责核心网控制功能。eNodeB发往EPC的流量主要包括信令流和业务流两种,MME用于处理信令流量。
- S-GW(Serving Gateway):业务网关,主要负责处理eNodeB发往EPC的业务流量。
- OMC(Operation and Maintenance Center):操作维护中心,包括M2000、CME、LMT等,管理员通过OMC对LTE网络中的网元进行集中管理、维护等操作。在实际使用中,为了管理方便,通常也会把证书服务器部署在OMC区域,例如CA服务器、RA服务器等。
eNodeB的接口
eNodeB主要有S1和X2两个接口:
- S1接口
S1接口是MME/S-GW网关和eNodeB之间的通信接口,S1接口按照不同的业务平面又分为S1用户平面接口和S1控制平面接口。
- S1用户平面接口(S1-U接口)
S1-U接口位于eNodeB和S-GW之间,主要传输eNodeB和S-GW之间的用户数据,也叫业务数据。S1-U接口利用了一个简单的“GTP over UDP/IP”传输协议,该协议负责对用户数据进行封装,在S1-U接口上没有任何流量控制、差错控制或是其他保证数据传输的机制。
- S1控制平面接口(S1-C接口)
S1-C接口位于eNodeB和MME之间,主要用来控制eNodeB和MME之间的一系列信令交互过程,为了可靠传输信令消息,S1-C接口在IP层之上采用SCTP协议。
- S1用户平面接口(S1-U接口)
- X2接口
X2接口是eNodeB基站之间进行通信的接口。X2接口是LTE网络新定义的接口,是一个网状接口,定义X2接口的主要目的是当用户移动时,可以在各个eNodeB间进行分组转发,以便降低分组丢包率。
- X2用户平面接口
X2用户平面接口(X2-U接口)主要在eNodeB间传输用户数据。这个接口只在终端从一个eNodeB移动到另一个eNodeB时使用,来实现数据的转发。X2-U接口也是采用“GTP over UDP/IP”协议进行数据传输。
- X2控制平面接口
X2控制面接口(X2-C接口)是eNodeB之间的信令接口,支持一系列eNodeB间的信令交互控制。X2-C与用户移动有关,用于实现eNodeB间传递用户上下文消息。X2-C接口和S1-C接口类似,也是采用SCTP协议保证传输。
- X2用户平面接口
方案设计
组网需求
在3G网络中,从用户终端(UE)到无线网络控制器(RNC),不管是控制面还是用户面,都设计有接入认证和数据加密机制,因此这里的数据传输已经做了安全保护。而在LTE网络中,虽然控制面从用户终端(UE)到核心网(EPC)仍然保留了接入认证和数据加密机制;但是在用户面,S1-U只有认证机制而没有加密机制,因此与3G网络相比,LTE网络就需要考虑部署额外的安全设备消除该安全隐患。
LTE IPSec解决方案通过在eNodeB和安全网关(即FW,在LTE中也被称为SeMG)之间建立IPSec隧道,对S1数据流进行安全加密保护,防止用户数据在IP-RAN中被入侵,从而保障LTE网络的安全性。通常,FW会被旁路部署到EPC区域路由器的两侧,作为eNodeB访问MME和S-GW的IPSec网关,两台FW形成双机热备,可以提高网络的稳定性,其组网拓扑如图1-2所示。
在LTE IPSec方案中,eNodeB的流量主要包括S1接口流量,X2接口流量,还有与网管通信的OM流量和PKI流量,运营商出于安全性和实时性考虑,对各种流量有不同的处理要求,具体如下。
- S1接口流量
S1接口流量按照语音、信令分为用户层面的流量(S1 UP)和控制层面的流量(S1 CP),该流量安全性要求高,因此需要通过IPSec隧道进行传输。
- X2接口流量
X2接口流量是突发流量,对安全性要求不高,加密和不加密均可以。考虑到IPSec隧道封装会导致X2流量的时延增大,因此本案例中对该流量不做IPSec加密处理。
- OM流量
eNodeB、FW等网络设备要受OM服务器进行统一管理,此管理流量无需IPSec隧道保护。例如,OM中的NTP服务器与eNodeB进行时钟同步时,对流量抖动要求高,所以不适宜进行IPSec加密。
- PKI流量
PKI负责向eNodeB和IPSec网关发放证书,eNodeB和IPSec网关在建立IPSec隧道时,通过交换证书验证对方身份,此流量也无需IPSec保护直接由eNodeB发往PKI服务器。
各种流量的传输路径如图1-3所示。
业务规划
可靠性业务规划
FW作为IPSec安全网关用于处理eNodeB发往MME和S-GW的所有流量,是流量转发的枢纽节点,其位置非常关键。因此,FW通常会在该节点进行双机部署,双机形成主备备份关系。除了采用了设备级的备份方案,此处还使用了链路级备份。例如,双机之间的心跳口采用Eth-Trunk链路不仅可以提高链路带宽,而且可以确保在部分链路故障的情况下双机之间能够继续进行数据备份。
数据规划
FW使用普通的物理接口与eNodeB建立IPSec时,如果双机中的主机出现故障,就会引发双机主备倒换。eNodeB在获悉主机故障后,就会拆除与主机间的IPSec隧道,并向新主机(原来的备机)发起IPSec协商请求,在此过程中管理员就需要将eNodeB上IPSec隧道的对端地址修改成新主机的IP地址。而手工修改eNodeB的配置实施起来会比较麻烦,eNodeB数量较少时采取手工修改的办法还基本可行,但实际应用中eNodeB的数量通常成百上千,再采用逐一修改的办法就不现实。
因此,在本案例中FW将采用Tunnel接口与eNodeB建立IPSec隧道,并且FW_A、FW_B上的Tunnel接口IP地址相同。采用Tunnel接口与eNodeB建立IPSec隧道的优势在于,即使双机发生了主备倒换,由于双机建立IPSec隧道所使用的Tunnel接口是同一个IP地址,这样eNodeB就无需修改IPSec隧道对端IP地址。
设备 |
接口 |
IP地址 |
安全区域 |
---|---|---|---|
FW_A |
Eth-trunk1 Eth-trunk1的成员接口:GigabitEthernet1/0/1和GigabitEthernet1/0/2 |
子接口Eth-trunk1.1的IP:1.1.1.1/30 VLAN:100 Eth-trunk1.1接口用于处理eNodeB发往EPC的IPSec加密流量。 |
子接口Eth-trunk1.1:Untrust 子接口Eth-trunk1.2:Trust 子接口Eth-trunk1.3:Trust 子接口Eth-trunk1.4:Trust |
子接口Eth-trunk1.2的IP:1.1.2.1/30 VLAN:200 Eth-trunk1.2接口用于处理eNodeB发往S-GW解密后的业务流量。 |
|||
子接口Eth-trunk1.3的IP:1.1.3.1/30 VLAN:300 Eth-trunk1.3接口用于处理eNodeB发往MME解密后的信令流量。 |
|||
子接口Eth-trunk1.4的IP:1.1.4.1/30 VLAN:400 Eth-trunk1.4接口作为FW的带内管理口。 |
|||
Eth-trunk2 Eth-trunk2的成员接口:GigabitEthernet1/0/8和GigabitEthernet2/0/8 |
2.1.1.1/30 |
DMZ |
|
Tunnel接口 Tunnel接口用于和eNodeB建立IPSec隧道。 |
3.1.1.1/30 |
Untrust |
|
FW_B |
Eth-trunk1 子接口Eth-trunk2的成员接口:GigabitEthernet1/0/1和GigabitEthernet1/0/2 |
子接口Eth-trunk1.1的IP:5.1.1.1/30 VLAN:100 Eth-trunk1.1接口用于双机主备切换以后处理eNodeB发往EPC的IPSec加密流量。 |
子接口Eth-trunk1.1:Untrust 子接口Eth-trunk1.2:Trust 子接口Eth-trunk1.3:Trust 子接口Eth-trunk1.4:Trust |
子接口Eth-trunk1.2的IP:5.1.2.1/30 VLAN:200 Eth-trunk1.2接口用于双机主备切换以后处理eNodeB发往S-GW解密后的业务流量。 |
|||
子接口Eth-trunk1.3的IP:5.1.3.1/30 VLAN:300 Eth-trunk1.3接口用于双机主备切换以后处理eNodeB发往MME解密后的信令流量。 |
|||
子接口Eth-trunk1.4的IP:5.1.4.1/30 VLAN:400 Eth-trunk1.4接口作为FW的带内管理口。 |
|||
Eth-trunk2 Eth-trunk2成员接口:GigabitEthernet1/0/8和GigabitEthernet2/0/8 |
2.1.1.2/30 |
DMZ |
|
Tunnel接口 Tunnel接口用于和eNodeB建立IPSec隧道。 |
3.1.1.1/30 |
Untrust |
|
eNodeB-1 |
1个隧道接口+3个业务接口 |
Tunnel IP:6.1.1.1/30 UP业务IP:6.1.2.1/32 CP业务IP:6.1.3.1/32 OM业务IP:6.1.4.1/30 |
隧道接口:Untrust 业务接口:Trust |
eNodeB-2 |
1个隧道接口+3个业务接口 |
Tunnel IP:7.1.1.1/30 UP业务IP:7.1.2.1/32 CP业务IP:7.1.3.1/32 OM业务IP:7.1.4.1/30 |
隧道接口:Untrust 业务接口:Trust |
S-GW |
S1-U业务接口 |
8.1.1.1/30 |
- |
MME |
S1-C业务接口 |
8.1.1.2/30 |
- |
OM |
U2000 |
9.1.1.1/30 |
- |
NTP Server |
9.1.1.2/30 |
- |
|
Log Server |
9.1.1.3/30 |
- |
|
PKI |
CA |
9.1.2.4/30 |
- |
路由规划
FW以双机方式旁路部署到LTE网络中以后,首先要将eNodeB访问MME和S-GW(即EPC区域)的加密流量引导到FW,然后FW对流量进行解密,最后再将解密流量重新发往EPC区域。路由决定了流量的走向,为了使流量按照预想的线路传送,需要对FW及RSG设备上的路由进行如下规划,如图1-6所示。
在FW上创建OSPF1和OSPF2两个进程,OSPF1进程用于将FW的IPSec网关路由发布到IP-RAN,使eNodeB能够获取到达FW的路由;OSPF2进程用于FW与EPC进行路由交换,FW根据该路由转发解密后的流量到EPC。FW和RSG之间的Eth-Trunk子接口分别用于区分IPSec加密流量、解密后到S-GW的流量和解密后到MME的流量。
- 上行流量
eNodeB发往EPC的上行流量依赖的路由信息,其路由交换过程如下,下面以eNodeB-1经IP-RAN、FW_A、RSG-1到EPC线路路由交换为例进行说明。
- FW_A发布IPSec网关路由到OSPF1。
- 在RSG-1上引入OSPF1路由到BGP。
- RSG-1通过IBGP发布IPSec网关路由到AGG。
- AGG接收到IPSec网关路由并通告至整个IP-RAN。
eNodeB通过静态路由将IPSec流量转发至IP-RAN时,IP-RAN就会通过学习到的IPSec网关路由将IPSec流量一路送至FW_A。
FW_A通过OSPF2进程学习到EPC的路由,上行IPSec流量经过解密以后,该流量会再通过OSP2进程学习到的路由转发至EPC。
- 下行流量
EPC响应eNodeB下行流量依赖的路由信息,其路由交换过程如下,下面以EPC经RSG-1、FW_A、IP-RAN到eNodB-1线路路由交换为例进行说明。
- AN通过引入直连路由到IP-RAN,IP-RAN就可以学习到eNodB-1的IPSec Tunnel路由。
- RSG-1通过IBGP从IP-RAN学习到eNodeB-1的IPSec Tunnel路由。
- RSG-1将IBGP学习到的eNodeB-1的IPSec Tunnel路由引入到OSPF1,于是FW_A就学习到了eNodeB-1的隧道路由。
EPC响应eNodeB-1的流量按照OSPF2进程中学习到的路由被转发到FW_A,流量按照FW_A IPSec反向路由注入中学习到的路由进入IPSec隧道。FW_A按照OSPF1进程中学习到的eNodeB-1的路由将封装后的IPSec流量发送至IP-RAN,IP-RAN再将流量一路送至eNodeB-1。
双机情况下,主IPSec网关(FW_A)对外发布的OSPF的cost值为原始值(可自行设定),备用IPSec网关(FW_B)发布的OSPF的cost值为65500,一般设置cost原始值小于65500。eNodeB发往EPC的流量到达RSG以后,RSG会选择路由开销小的链路将流量发往FW_A。由于RSG-1和RSG-2的Eth-Trunk子接口Trunk2.1也被加入到了OSPF1进程,因此OSPF1的cost值会在FW_A、RSG-1、RSG-2、FW_B四者之间传递,因而无论eNodeB发往EPC的流量是到达RSG-1还是RSG-2,RSG都会选择开销小的链路将流量发送至FW_A。当FW_A故障时,双机发生主备倒换,路由开销同步切换,流量依旧按照路由开销小的链路转发,只是此时流量会转发给FW_B,而不是FW_A。
注意事项
- IPSec配置
- eNodeB中的隧道地址和业务地址需要使用不同的地址。
- 如果本场景中不进行异地容灾,则FW中配置到eNodeB的隧道路由时,则无需强制使用IPSec反向路由注入功能,采用手工方式配置静态路由也可以。
- 组网部署
当前LTE IPSec解决方案中,FW大多数为双机旁路部署,很少使用直路部署,因为旁路部署可以减少对原有网络拓扑的影响。
- MTU
由于IPSec加密增加了报文长度,因此部署IPSec网关后需要调整整条路径的MTU,具体调整方式有2种:
- 减小EPC侧和eNodeB侧MTU,而中间其他节点不需要进行调整,此方案的优点是需要调整的设备数量少。
- 增加中间IPCore、IPRAN和传输节点的MTU,此方案的优点是传输效率高,每报文IPSec头占报文总长小。
传输效率=1–IPSec头/报文长度,IPSec头的长度是固定的,报文长度越大,传输效率越高。选择何种MTU调整方式,取决于现网的运行环境。
IPSec封装后的报文长度如下图所示。
AES + MD5/SHA1: 20 (New IPHeader) + 4 (SPI) + 4 (SeqNum) + 16 (IV) + 16 (ESP Auth) + 2~17 (Padding) = 62~77 Byte
对于不同的完整性验证算法,ESP Auth长度是不同的,以上计算结果是基于SHA2-256计算,这也是推荐的完整性验证算法。其他几种封装方式下ESP Auth值为: MD5=12,SHA1=12,SHA2-256=16,SHA2-384=24,SHA2-512=32。对于SHA2-384和SHA2-512,由于当前版本与第三方设备对接时会存在问题,因此不建议使用。
因为报文在IP-RAN传输还需要封装2层标签,共8字节。所以,报文在IPSec网关进行加密后,进入IP-RAN以后,报文长度增加到70~85字节(基于SHA2-256计算)。
对于新建IP-RAN和IPCore项目,建议在设计MTU时,考虑多预留100字节,如果后续增加IPSec网关,则不需要再对IP-RAN和IPCore设备进行调整。
- QoS
在LTE端到端方案中,当上行报文从IPSec隧道中解封装后,外层报文的DSCP映射到解密后的报文的IP头;当下行报文到达IPSec网关进行IPSec封装时,内层报文的DSCP映射到外层报文,因此本方案中IPSec网关不需要对报文QoS值进行调整。
方案配置
配置接口和安全区域
背景信息
按下图配置接口和安全区域。
操作步骤
- 配置FW_A接口IP地址。
<FW_A> system-view [FW_A] sysname FW_A [FW_A] interface Eth-Trunk 1 [FW_A-Eth-Trunk1] quit [FW_A] interface GigabitEthernet 1/0/1 [FW_A-GigabitEthernet1/0/1] description eth-trunk1 [FW_A-GigabitEthernet1/0/1] Eth-Trunk 1 [FW_A] interface GigabitEthernet 1/0/2 [FW_A-GigabitEthernet1/0/2] description eth-trunk1 [FW_A-GigabitEthernet1/0/2] Eth-Trunk 1 [FW_A-GigabitEthernet1/0/2] quit [FW_A] interface Eth-Trunk 2 [FW_A-Eth-Trunk2] quit [FW_A] interface GigabitEthernet 1/0/8 [FW_A-GigabitEthernet1/0/8] description eth-trunk2 [FW_A-GigabitEthernet1/0/8] Eth-Trunk 2 [FW_A-GigabitEthernet1/0/8] quit [FW_A] interface GigabitEthernet 2/0/8 [FW_A-GigabitEthernet2/0/8] description eth-trunk2 [FW_A-GigabitEthernet2/0/8] Eth-Trunk 2 [FW_A-GigabitEthernet2/0/8] quit [FW_A] interface Eth-Trunk 1.1 [FW_A-Eth-Trunk1.1] ip address 1.1.1.1 30 [FW_A-Eth-Trunk1.1] vlan-type dot1q 100 [FW_A-Eth-Trunk1.1] quit [FW_A] interface Eth-Trunk 1.2 [FW_A-Eth-Trunk1.2] ip address 1.1.2.1 30 [FW_A-Eth-Trunk1.2] vlan-type dot1q 200 [FW_A-Eth-Trunk1.2] quit [FW_A] interface Eth-Trunk 1.3 [FW_A-Eth-Trunk1.3] ip address 1.1.3.1 30 [FW_A-Eth-Trunk1.3] vlan-type dot1q 300 [FW_A-Eth-Trunk1.3] quit [FW_A] interface Eth-Trunk 1.4 [FW_A-Eth-Trunk1.4] ip address 1.1.4.1 30 [FW_A-Eth-Trunk1.4] vlan-type dot1q 400 [FW_A-Eth-Trunk1.4] quit [FW_A] interface Eth-Trunk 2 [FW_A-Eth-Trunk2] ip address 2.1.1.1 30 [FW_A-Eth-Trunk2] quit [FW_A] interface Tunnel 1 [FW_A-Tunnel1] ip address 3.1.1.1 30 [FW_A-Tunnel1] tunnel-protocol ipsec [FW_A-Tunnel1] quit
- 将FW_A接口加入安全区域。
[FW_A] firewall zone trust [FW_A-zone-trust] add interface Eth-Trunk 1.2 [FW_A-zone-trust] add interface Eth-Trunk 1.3 [FW_A-zone-trust] add interface Eth-Trunk 1.4 [FW_A-zone-trust] quit [FW_A] firewall zone untrust [FW_A-zone-untrust] add interface Eth-Trunk 1.1 [FW_A-zone-untrust] add interface Tunnel 1 [FW_A-zone-untrust] quit [FW_A] firewall zone dmz [FW_A-zone-dmz] add interface Eth-Trunk 2 [FW_A-zone-dmz] quit
- 参考上述步骤配置FW_B的接口IP和安全区域,不同之处是接口IP不同。
配置双机热备
背景信息
按照下图进行双机配置。
操作步骤
- 配置双机热备。
# 在FW_A上配置双机热备功能。
- 配置VGMP组监控Eth-Trunk1接口。
[FW_A] hrp track interface Eth-Trunk 1
- 启用根据VGMP组状态调整OSPF的Cost值功能。
[FW_A] hrp adjust ospf-cost enable
- 指定Eth-Trunk2口为心跳接口,启用双机热备。
[FW_A] hrp interface Eth-Trunk 2 remote 2.1.1.2 HRP_M[FW_A] hrp enable
# 在FW_B上配置双机热备功能。
- 配置VGMP组监控Eth-Trunk1业务接口。
[FW_B] hrp track interface Eth-Trunk 1
- 指定FW_B为备用设备。
[FW_B] hrp standby-device
- 启用根据VGMP组状态调整OSPF的Cost值功能。
[FW_B] hrp adjust ospf-cost enable
- 指定Eth-Trunk2为心跳接口,启用双机热备。
[FW_B] hrp interface Eth-Trunk 2 remote 2.1.1.1 HRP_S[FW_B] hrp enable
- 配置VGMP组监控Eth-Trunk1接口。
- 配置OSPF。
# 在FW_A上配置OSPF。
HRP_M[FW_A] router id 1.1.1.1 HRP_M[FW_A] ospf 1 HRP_M[FW_A-ospf-1] area 1.1.1.1 HRP_M[FW_A-ospf-1-area-1.1.1.1] network 1.1.1.1 0.0.0.3 HRP_M[FW_A-ospf-1-area-1.1.1.1] network 3.1.1.1 0.0.0.3 HRP_M[FW_A-ospf-1-area-1.1.1.1] quit HRP_M[FW_A-ospf-1] quit
# 在FW_B上配置OSPF。
HRP_S[FW_A] router id 5.5.5.1 HRP_S[FW_A] ospf 1 HRP_S[FW_A-ospf-1] area 1.1.1.1 HRP_S[FW_A-ospf-1-area-1.1.1.1] network 5.1.1.1 0.0.0.3 HRP_S[FW_A-ospf-1-area-1.1.1.1] network 3.1.1.1 0.0.0.3 HRP_S[FW_A-ospf-1-area-1.1.1.1] quit HRP_S[FW_A-ospf-1] quit
配置IPSec
操作步骤
- 配置FW_A。
- 使用CMPv2协议为FW_A在线申请证书。
- 创建一个2048位的RSA密钥对rsa_cmp,并设置为可以从设备上导出。
HRP_M[FW_A] pki rsa local-key-pair create rsa_cmp exportable Info: The name of the new key-pair will be: rsa_cmp The size of the public key ranges from 2048 to 4096. Input the bits in the modules:2048 Generating key-pairs... ...........+++ ...........+++
- 配置实体信息。
HRP_M[FW_A] pki entity ngfwa HRP_M[FW_A-pki-entity-ngfwa] common-name hello HRP_M[FW_A-pki-entity-ngfwa] country cn HRP_M[FW_A-pki-entity-ngfwa] email test@user.com HRP_M[FW_A-pki-entity-ngfwa] fqdn test.abc.com HRP_M[FW_A-pki-entity-ngfwa] ip-address 3.1.1.1 HRP_M[FW_A-pki-entity-ngfwa] state jiangsu HRP_M[FW_A-pki-entity-ngfwa] organization huawei HRP_M[FW_A-pki-entity-ngfwa] organization-unit info HRP_M[FW_A-pki-entity-ngfwa] quit
配置CMP会话。
配置的CA名称中各个字段的顺序必须要和实际CA证书中的顺序保持一致,否则服务器端会认为是错误的。
# 创建CMP会话cmp。 HRP_M[FW_A] pki cmp session ngfwa # 指定CMP会话引用的PKI实体名称。 HRP_M[FW_A-pki-cmp-session-ngfwa] cmp-request entity ngfwa # 配置CA的名称,举例中假设为“C=cn,ST=jiangsu,L=SD,O=BB,OU=BB,CN=BB”。 HRP_M[FW_A-pki-cmp-session-ngfwa] cmp-request ca-name "C=cn,ST=jiangsu,L=SD,O=BB,OU=BB,CN=BB" # 配置申请证书的URL。 HRP_M[FW_A-pki-cmp-session-ngfwa] cmp-request server url http://9.1.2.4:8080 # 指定申请证书时使用的RSA密钥对,并设置为证书自动更新时同时更新RSA密钥对。 HRP_M[FW_A-pki-cmp-session-ngfwa] cmp-request rsa local-key-pair rsa_cmp regenerate # 首次申请证书时,使用消息认证码认证。配置消息认证码的参考值和秘密值,举例中假设分别为“1234”和“123456”。 HRP_M[FW_A-pki-cmp-session-ngfwa] cmp-request message-authentication-code 1234 123456 HRP_M[FW_A-pki-cmp-session-ngfwa] quit # 根据CMP会话的配置信息向CMPv2服务器进行首次证书申请。 HRP_M[FW_A] pki cmp initial-request session ngfwa HRP_M[FW_A] Info: Initializing configuration. Info: Creatting initial request packet. Info: Connectting to CMPv2 server. Info: Sending initial request packet. Info: Waitting for initial response packet. Info: Creatting confirm packet. Info: Connectting to CMPv2 server. Info: Sending confirm packet. Info: Waitting for confirm packet from server. Info: CMPv2 operation finish.
获取到的CA、RA、本地证书将会分别被命名为ngfwa_ca.cer、ngfw_ra.cer和ngfwa_local.cer保存在CF卡中。
- 安装证书。
# 导入CA/RA证书到内存。
HRP_M[FW_A] pki import-certificate ca filename ngfwa_ca.cer HRP_M[FW_A] pki import-certificate ca filename ngfw_ra.cer
# 导入本地证书到内存。
HRP_M[FW_A] pki import-certificate local filename ngfwa_local.cer
- 创建一个2048位的RSA密钥对rsa_cmp,并设置为可以从设备上导出。
- 在FW_A上配置IPSec策略,并在接口上应用此IPSec策略。
- 定义被保护的数据流。
现网环境中可能存在成百上千台eNodeB设备,在配置ACL的rule时,destination网段要包含所有eNodeB的Service IP,保证EPC返回给eNodeB的UP和CP流量都能进入IPSec隧道传输。本例中只以两个eNodeB的配置进行说明。
HRP_M[FW_A] acl 3000 HRP_M[FW_A-acl-adv-3000] rule permit ip source 8.1.1.0 0.0.0.255 destination 6.1.0.0 0.0.255.255 HRP_M[FW_A-acl-adv-3000] rule permit ip source 8.1.1.0 0.0.0.255 destination 7.1.0.0 0.0.255.255 HRP_M[FW_A-acl-adv-3000] quit
- 配置IPSec安全提议。
HRP_M[FW_A] ipsec proposal tran1 HRP_M[FW_A-ipsec-proposal-tran1] transform esp HRP_M[FW_A-ipsec-proposal-tran1] esp authentication-algorithm sha2-256 HRP_M[FW_A-ipsec-proposal-tran1] esp encryption-algorithm aes-256 HRP_M[FW_A-ipsec-proposal-tran1] encapsulation-mode tunnel HRP_M[FW_A-ipsec-proposal-tran1] quit
- 配置IKE安全提议。
HRP_M[FW_A] ike proposal 10 HRP_M[FW_A-ike-proposal-10] authentication-method rsa-signature HRP_M[FW_A-ike-proposal-10] encryption-algorithm aes-256 HRP_M[FW_A-ike-proposal-10] dh group2 HRP_M[FW_A-ike-proposal-10] integrity-algorithm hmac-sha2-256 HRP_M[FW_A-ike-proposal-10] quit
- 配置IKE Peer。
HRP_M[FW_A] ike peer eNodeB HRP_M[FW_A-ike-peer-eNodeB] ike-proposal 10 HRP_M[FW_A-ike-peer-eNodeB] local-id-type ip HRP_M[FW_A-ike-peer-eNodeB] remote-id-type dn HRP_M[FW_A-ike-peer-eNodeB] certificate local-filename ngfwa_local.cer HRP_M[FW_A-ike-peer-eNodeB] remote-id /CN=eNodeB //CN=eNodeB是eNodeB设备证书中“主题”字段的取值 HRP_M[FW_A-ike-peer-eNodeB] undo version 1 HRP_M[FW_A-ike-peer-eNodeB] quit
- 配置策略模板policy1,并在IPSec安全策略组map1中引用该策略模板。
FW使用IPSec动态反向路由注入功能可以自动生成到eNodeB Service IP的路由。当IPSec隧道正常时,路由自动生成;当IPSec隧道故障时,该路由会被自动删除。动态反向路由注入功能将生成的静态路由与IPSec隧道状态相关联,避免了IPSec隧道Down时对等体仍向IPSec隧道发送流量,造成流量的丢失。
HRP_M[FW_A] ipsec policy-template policy1 1 HRP_M[FW_A-ipsec-policy-template-policy1-1] security acl 3000 HRP_M[FW_A-ipsec-policy-template-policy1-1] proposal tran1 HRP_M[FW_A-ipsec-policy-template-policy1-1] ike-peer eNodeB HRP_M[FW_A-ipsec-policy-template-policy1-1] route inject dynamic HRP_M[FW_A-ipsec-policy-template-policy1-1] quit HRP_M[FW_A] ipsec policy map1 10 isakmp template policy1
- 配置到EPC的OSPF动态路由。
在OSPF2进程中引入IPSec动态反向路由注入中生成的路由,用与指导EPC响应eNodeB的流量转发,路由下一跳指向IPSec隧道的Tunnel接口。
HRP_M[FW_A] ospf 2 HRP_M[FW_A-ospf-2] import-route unr HRP_M[FW_A-ospf-2] area 1.1.1.1 HRP_M[FW_A-ospf-2-area-1.1.1.1] network 1.1.2.0 0.0.0.3 HRP_M[FW_A-ospf-2-area-1.1.1.1] quit HRP_M[FW_A-ospf-2] area 1.1.2.1 HRP_M[FW_A-ospf-2-area-1.1.2.1] network 1.1.3.0 0.0.0.3 HRP_M[FW_A-ospf-2-area-1.1.2.1] quit HRP_M[FW_A-ospf-2] area 1.1.3.1 HRP_M[FW_A-ospf-2-area-1.1.3.1] network 1.1.4.0 0.0.0.3 HRP_M[FW_A-ospf-2-area-1.1.3.1] quit HRP_M[FW_A-ospf-2] quit
- 在Tunnel接口上应用安全策略组map1。
HRP_M[FW_A] interface Tunnel 1 HRP_M[FW_A-Tunnel1] ipsec policy map1 HRP_M[FW_A-Tunnel1] quit
- 定义被保护的数据流。
- 使用CMPv2协议为FW_A在线申请证书。
- 配置FW_B。
双机启动后,FW_A除路由配置外,其他配置信息会自动备份到FW_B上,因此FW_B上无需配置。
在OSPF2进程中引入IPSec动态反向路由注入中生成的路由,用与指导EPC响应eNodeB的流量转发,路由下一跳指向IPSec隧道的Tunnel接口。
HRP_M[FW_B] ospf 2 HRP_M[FW_B-ospf-2] import-route unr HRP_M[FW_B-ospf-2] area 1.1.1.1 HRP_M[FW_B-ospf-2-area-1.1.1.1] network 5.1.2.0 0.0.0.3 HRP_M[FW_B-ospf-2-area-1.1.1.1] quit HRP_M[FW_B-ospf-2] area 1.1.2.1 HRP_M[FW_B-ospf-2-area-1.1.2.1] network 5.1.3.0 0.0.0.3 HRP_M[FW_B-ospf-2-area-1.1.2.1] quit HRP_M[FW_B-ospf-2] area 1.1.3.1 HRP_M[FW_B-ospf-2-area-1.1.3.1] network 5.1.4.0 0.0.0.3 HRP_M[FW_B-ospf-2-area-1.1.3.1] quit HRP_M[FW_B-ospf-2] quit
配置安全策略
操作步骤
- 配置安全策略。
- 配置Trust、Untrust与Local域的安全策略,允许OSPF报文能够通过FW_A。
HRP_M[FW_A] security-policy HRP_M[FW_A-policy-security] rule name 1 HRP_M[FW_A-policy-security-rule-1] source-zone trust HRP_M[FW_A-policy-security-rule-1] source-zone untrust HRP_M[FW_A-policy-security-rule-1] destination-zone local HRP_M[FW_A-policy-security-rule-1] service ospf HRP_M[FW_A-policy-security-rule-1] action permit HRP_M[FW_A-policy-security-rule-1] quit HRP_M[FW_A-policy-security] rule name 2 HRP_M[FW_A-policy-security-rule-2] source-zone local HRP_M[FW_A-policy-security-rule-2] destination-zone trust HRP_M[FW_A-policy-security-rule-2] destination-zone untrust HRP_M[FW_A-policy-security-rule-2] service ospf HRP_M[FW_A-policy-security-rule-2] action permit HRP_M[FW_A-policy-security-rule-2] quit
- 配置Untrust域与Local域的安全策略,允许IPSec协商报文能够通过FW_A。
HRP_M[FW_A] security-policy HRP_M[FW_A-policy-security] rule name 3 HRP_M[FW_A-policy-security-rule-3] source-zone local HRP_M[FW_A-policy-security-rule-3] destination-zone untrust HRP_M[FW_A-policy-security-rule-3] source-address 3.1.1.1 32 HRP_M[FW_A-policy-security-rule-3] destination-address 6.1.1.1 30 HRP_M[FW_A-policy-security-rule-3] destination-address 7.1.1.1 30 HRP_M[FW_A-policy-security-rule-3] action permit HRP_M[FW_A-policy-security-rule-3] quit HRP_M[FW_A-policy-security] rule name 4 HRP_M[FW_A-policy-security-rule-4] source-zone untrust HRP_M[FW_A-policy-security-rule-4] destination-zone local HRP_M[FW_A-policy-security-rule-4] source-address 6.1.1.1 30 HRP_M[FW_A-policy-security-rule-4] source-address 7.1.1.1 30 HRP_M[FW_A-policy-security-rule-4] destination-address 3.1.1.1 32 HRP_M[FW_A-policy-security-rule-4] action permit HRP_M[FW_A-policy-security-rule-4] quit
- 配置Untrust域与Trust域的安全策略,允许解封装后的IPSec流量能够通过FW_A。
HRP_M[FW_A] security-policy HRP_M[FW_A-policy-security] rule name 5 HRP_M[FW_A-policy-security-rule-5] source-zone untrust HRP_M[FW_A-policy-security-rule-5] destination-zone trust HRP_M[FW_A-policy-security-rule-5] source-address 6.1.0.0 16 HRP_M[FW_A-policy-security-rule-5] source-address 7.1.0.0 16 HRP_M[FW_A-policy-security-rule-5] destination-address 8.1.1.1 30 HRP_M[FW_A-policy-security-rule-5] action permit HRP_M[FW_A-policy-security-rule-5] quit HRP_M[FW_A-policy-security] rule name 6 HRP_M[FW_A-policy-security-rule-6] source-zone trust HRP_M[FW_A-policy-security-rule-6] destination-zone untrust HRP_M[FW_A-policy-security-rule-6] source-address 8.1.1.1 30 HRP_M[FW_A-policy-security-rule-6] destination-address 6.1.0.0 16 HRP_M[FW_A-policy-security-rule-6] destination-address 7.1.0.0 16 HRP_M[FW_A-policy-security-rule-6] action permit HRP_M[FW_A-policy-security-rule-6] quit
- 配置Trust、Untrust与Local域的安全策略,允许OSPF报文能够通过FW_A。
配置与服务器对接
操作步骤
- 配置与NTP Server对接。
HRP_M[FW_A] ntp-service unicast-server 9.1.1.2
- 配置与Log Server对接。
HRP_M[FW_A] log type traffic enable HRP_M[FW_A] firewall log host 1 9.1.1.3 9002
结果验证
- 配置完成后,eNodeB与FW_A之间的IPSec隧道成功建立,并且可以访问MME和S-GW。
- 在FW_A上查看IKE SA的建立情况。
<FW_A> display ike sa Spu board slot 1, cpu 0 ike sa information : Conn-ID Peer VPN Flag(s) Phase --------------------------------------------------------------- 16792025 6.1.1.1 RD|ST|M v2:2 16792024 6.1.1.1 RD|ST|M v2:1 83887864 7.1.1.1 RD|ST|M v2:2 83887652 7.1.1.1 RD|ST|M v2:1 Number of SA entries : 4 Number of SA entries of all cpu : 4
- 在FW_A上查看IPSec SA的建立情况。
<FW_A> display ipsec sa brief Current ipsec sa num:4 Spu board slot 1, cpu 1 ipsec sa information: Number of SAs:2 Src address Dst address SPI VPN Protocol Algorithm ------------------------------------------------------------------------------- 3.1.1.1 6.1.1.1 3923280450 ESP E:AES-256 A:SHA2-256-128 6.1.1.1 3.1.1.1 787858613 ESP E:AES-256 A:SHA2-256-128 3.1.1.1 7.1.1.1 3923280452 ESP E:AES-256 A:SHA2-256-128 7.1.1.1 3.1.1.1 787858611 ESP E:AES-256 A:SHA2-256-128
- 在FW_A上执行display hrp state命令,检查当前HRP的状态。
HRP_M[FW_A] display hrp state Role: active, peer: active Running priority: 49012, peer: 49012 Backup channel usage: 3% Stable time: 0 days, 5 hours, 1 minutes
配置脚本
FW_A |
FW_B |
---|---|
# sysname FW_A # hrp enable hrp interface Eth-Trunk 2 remote 2.1.1.2 hrp track interface Eth-Trunk 1 hrp adjust ospf-cost enable # pki entity ngfwa country CN state jiangsu organization huawei organization-unit info common-name hello fqdn test.abc.com ip-address 3.1.1.1 email test@user.com # pki cmp session ngfwa cmp-request entity ngfwa cmp-request ca-name "C=cn,ST=jiangsu,L=SD,O=BB,OU=BB,CN=BB" cmp-request server url http://9.1.2.4:8080 cmp-request rsa local-key-pair rsa_cmp regenerate cmp-request message-authentication-code 1234 123456 # pki cmp initial-request session ngfwa # pki import-certificate ca filename ngfwa_ca.cer pki import-certificate ca filename ngfw_ra.cer pki import-certificate local filename ngfwa_local.cer # acl number 3000 rule 5 permit ip source 8.1.1.0 0.0.0.255 destination 6.1.0.0 0.0.255.255 rule 10 permit ip source 8.1.1.0 0.0.0.255 destination 7.1.0.0 0.0.255.255 # ipsec proposal tran1 esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256 # ike proposal 10 encryption-algorithm aes-256 dh group2 authentication-algorithm sha2-256 authentication-method rsa-signature integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer eNodeB undo version 1 ike-proposal 10 local-id-type ip remote-id-type dn remote-id /CN=eNodeB certificate local-filename ngfwa_local.cer # ipsec policy-template policy1 1 security acl 3000 ike-peer eNodeB proposal tran1 route inject dynamic # ipsec policy map1 10 isakmp template policy1 # interface Eth-Trunk 1 # interface GigabitEthernet 1/0/1 description eth-trunk1 Eth-Trunk 1 # interface GigabitEthernet 1/0/2 description eth-trunk1 Eth-Trunk 1 # interface Eth-Trunk 2 ip address 2.1.1.1 255.255.255.252 # interface GigabitEthernet 1/0/8 description eth-trunk2 Eth-Trunk 2 # interface GigabitEthernet 2/0/8 description eth-trunk2 Eth-Trunk 2 # interface Eth-Trunk 1.1 vlan-type dot1q 100 ip address 1.1.1.1 255.255.255.252 # interface Eth-Trunk 1.2 vlan-type dot1q 200 ip address 1.1.2.1 255.255.255.252 # interface Eth-Trunk 1.3 vlan-type dot1q 300 ip address 1.1.3.1 255.255.255.252 # interface Eth-Trunk 1.4 vlan-type dot1q 400 ip address 1.1.4.1 255.255.255.252 # interface Tunnel 1 ip address 3.1.1.1 255.255.255.252 tunnel-protocol ipsec ipsec policy map1 # router id 1.1.1.1 # ospf 1 area 1.1.1.1 network 1.1.1.0 0.0.0.3 network 3.1.1.0 0.0.0.3 # ospf 2 import-route unr area 1.1.1.1 network 1.1.2.0 0.0.0.3 area 1.1.2.1 network 1.1.3.0 0.0.0.3 area 1.1.3.1 network 1.1.4.0 0.0.0.3 # ntp-service unicast-server 9.1.1.2 # log type traffic enable firewall log host 1 9.1.1.3 9002 # info-center enable snmp-agent snmp-agent sys-info version v2c snmp-agent target-host inform address udp-domain 9.1.1.1 params securitynam e private@123 v2c # firewall zone trust set priority 85 add interface Eth-Trunk1.2 add interface Eth-Trunk1.3 add interface Eth-Trunk1.4 # firewall zone untrust set priority 85 add interface Eth-Trunk1.1 add interface Tunnel1 # firewall zone dmz set priority 50 add interface Eth-Trunk2 # security-policy rule name 1 source-zone trust source-zone untrust destination-zone local service ospf action permit rule name 2 source-zone local destination-zone trust destination-zone untrust service ospf action permit rule name 3 source-zone local destination-zone untrust source-address 3.1.1.1 32 destination-address 6.1.1.1 30 destination-address 7.1.1.1 30 action permit rule name 4 source-zone untrust destination-zone local source-address 6.1.1.1 30 source-address 7.1.1.1 30 destination-address 3.1.1.1 32 action permit rule name 5 source-zone untrust destination-zone trust source-address 6.1.0.0 16 source-address 7.1.0.0 16 destination-address 8.1.1.1 30 action permit rule name 6 source-zone trust destination-zone untrust source-address 8.1.1.1 30 destination-address 6.1.0.0 16 destination-address 7.1.0.0 16 action permit # return |
# sysname FW_B # hrp enable hrp interface Eth-Trunk 2 remote 2.1.1.1 hrp track interface Eth-Trunk 1 hrp standby-device hrp adjust ospf-cost enable # pki entity ngfwa country CN state jiangsu organization huawei organization huaweiorganization-unit info common-name hello fqdn test.abc.com ip-address 3.1.1.1 email test@user.com # pki cmp session ngfwa cmp-request entity ngfwa cmp-request ca-name "C=cn,ST=jiangsu,L=SD,O=BB,OU=BB,CN=BB" cmp-request server url http://9.1.2.4:8080 cmp-request rsa local-key-pair rsa_cmp regenerate cmp-request message-authentication-code 1234 123456 # pki cmp initial-request session ngfwa # pki import-certificate ca filename ngfwa_ca.cer pki import-certificate ca filename ngfw_ra.cer pki import-certificate local filename ngfwa_local.cer # acl number 3000 rule 5 permit ip source 8.1.1.0 0.0.0.255 destination 6.1.0.0 0.0.255.255 rule 10 permit ip source 8.1.1.0 0.0.0.255 destination 7.1.0.0 0.0.255.255 # ipsec proposal tran1 esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256 # ike proposal 10 encryption-algorithm aes-256 dh group2 authentication-algorithm sha2-256 authentication-method rsa-signature integrity-algorithm hmac-sha2-256 prf hmac-sha2-256 # ike peer eNodeB undo version 1 ike-proposal 10 local-id-type ip remote-id-type dn remote-id /CN=eNodeB certificate local-filename ngfwa_local.cer # ipsec policy-template policy1 1 security acl 3000 ike-peer eNodeB proposal tran1 route inject dynamic # ipsec policy map1 10 isakmp template policy1 # interface Eth-Trunk 1 # interface GigabitEthernet 1/0/1 description eth-trunk1 Eth-Trunk 1 # interface GigabitEthernet 1/0/2 description eth-trunk1 Eth-Trunk 1 # interface Eth-Trunk 2 ip address 2.1.1.2 255.255.255.252 # interface GigabitEthernet 1/0/8 description eth-trunk2 Eth-Trunk 2 # interface GigabitEthernet 2/0/8 description eth-trunk2 Eth-Trunk 2 # interface Eth-Trunk 1.1 vlan-type dot1q 1 ip address 5.1.1.1 255.255.255.252 # interface Eth-Trunk 1.2 vlan-type dot1q 2 ip address 5.1.2.1 255.255.255.252 # interface Eth-Trunk 1.3 vlan-type dot1q 3 ip address 5.1.3.1 255.255.255.252 # interface Eth-Trunk 1.4 vlan-type dot1q 4 ip address 5.1.4.1 255.255.255.252 # interface Tunnel 1 ip address 3.1.1.1 255.255.255.252 tunnel-protocol ipsec ipsec policy map1 # router id 5.1.1.1 # ospf 1 area 1.1.1.1 network 5.1.1.0 0.0.0.3 network 3.1.1.0 0.0.0.3 # ospf 2 import-route unr area 1.1.1.1 network 5.1.2.0 0.0.0.3 area 1.1.2.1 network 5.1.3.0 0.0.0.3 area 1.1.3.1 network 5.1.4.0 0.0.0.3 # ntp-service unicast-server 9.1.1.2 # log type traffic enable firewall log host 1 9.1.1.3 9002 # info-center enable snmp-agent snmp-agent sys-info version v2c snmp-agent target-host inform address udp-domain 9.1.1.1 params securitynam e private@123 v2c # firewall zone trust set priority 85 add interface Eth-Trunk1.2 add interface Eth-Trunk1.3 add interface Eth-Trunk1.4 # firewall zone untrust set priority 85 add interface Eth-Trunk1.1 add interface Tunnel1 # firewall zone dmz set priority 50 add interface Eth-Trunk2 # security-policy rule name 1 source-zone trust source-zone untrust destination-zone local service ospf action permit rule name 2 source-zone local destination-zone trust destination-zone untrust service ospf action permit rule name 3 source-zone local destination-zone untrust source-address 3.1.1.1 32 destination-address 6.1.1.1 30 destination-address 7.1.1.1 30 action permit rule name 4 source-zone untrust destination-zone local source-address 6.1.1.1 30 source-address 7.1.1.1 30 destination-address 3.1.1.1 32 action permit rule name 5 source-zone untrust destination-zone trust source-address 6.1.0.0 16 source-address 7.1.0.0 16 destination-address 8.1.1.1 30 action permit rule name 6 source-zone trust destination-zone untrust source-address 8.1.1.1 30 destination-address 6.1.0.0 16 destination-address 7.1.0.0 16 action permit # return |
可靠性方案
为了应对可能出现的一些故障,LTE中会针对关键区域提供容灾方案,下面根据对不同位置的容灾方案,说明其设计原理。
MME、S-GW和RSG间链路故障的容灾方案
如图1-9所示,假设当RSG-1与S-GW间的链路出现故障时,从FW_A发往S-GW的流量就不能从该链路走,而是要绕道到RSG-2再到达S-GW。通过将Eth Trunk2.3和Eth Trunk2.2加入到OSPF2进程,就可以保证RSG-1与S-GW间的链路出现故障时,引发OSPF2进程的路由开销发生变化,从而引导解封装后的IPSec流量经RSG-2转发。
AGG和RSG间链路故障的容灾方案
如图1-10所示,假设当AGG-1与RSG-1间的链路出现故障时,IP-RAN区域中的路由开销发生变化,从eNodeB发往FW_A的IPSec流量就不会从该链路走,而是绕道AGG-2到达RSG-2。由于Eth Trunk2.1被加入到OSPF1进程中,所以IPSec流量到达RSG-2,就会由RSG-2转发至RSG-1再到FW_A。这里RSG-2到FW_B(备机)的路由开销比RSG-2到FW_A(主机)的路由开销大,所以不用担心IPSec流量会由RSG-2转发到FW_B上去。
IPSec网关异地容灾方案
为了抵御地震、海啸、台风等不可抗力的自然灾害,保证通信网络能够正常运转,通常在规划网络时会考虑异地容灾方案。如图1-11所示,Remote site站点中的IPSec网关与本地站点的IPSec网关形成异地备份。假如现在本地站点受到某灾害影响,其FW_A和FW_B两台IPSec网关都出现了故障,EPC区域暂未受影响。eNodeB发出的IPSec流量就需要转发给远端站点中的IPSec网关处理,远端IPSec网关将IPSec流量解封装以后,再通过RSG设备转发至本站点EPC区域中的MME和S-GW设备。为了实现流量按照预期线路转发,则需要将本地站点的IPSec网关、RSG、远端站点的IPSec网关加入到指定的路由进程,实现路由互通,使得本地站点IPSec网关故障时,确保IPSec流量能够发往远端站点的IPSec网关。并且,要建立本地站点EPC区域的路由与远端站点IPSec网关路由互通,使解密后的流量能够转发到本地站点的EPC区域。