用于第 3 层 VPN 的 ES 隧道
为第 3 层 VPN 配置 ES 隧道接口
ES 隧道接口允许您在第 3 层 VPN 的 PE 和 CE 路由器之间配置 IP 安全 (IPsec) 隧道。IPsec 隧道可以包含一个或多个跃点。
以下章节说明如何在第 3 层 VPN 的 PE 和 CE 路由器之间配置 ES 隧道接口:
在 PE 路由器上配置 ES 隧道接口
要在 PE 路由器上配置 ES 隧道接口,请添加 unit 语句:
unit logical-unit-number {
tunnel {
source source-address;
destination destination-address;
}
family inet {
address address;
ipsec-sa security-association-name;
}
}
您可以在以下层级包含此语句:
[edit interfaces interface-name][edit logical-systems logical-system-name interfaces interface-name]
默认情况下,假定隧道目标地址位于默认互联网路由表 inet.0 中。对于使用手动安全关联 (SA) 的 IPsec 隧道,如果隧道目的地址不在默认的 inet.0 路由表中,则需要通过配置 routing-instance语句来指定要搜索隧道目的地址的路由表。如果隧道封装接口也是在路由实例下配置的,则会出现这种情况。
unit logical-unit-number {
tunnel {
source address;
destination address;
routing-instance {
destination routing-instance-name;
}
family inet {
address address;
ipsec-sa security-association-name;
}
family mpls;
}
}
您可以在以下层级包含这些语句:
[edit interfaces interface-name][edit logical-systems logical-system-name interfaces interface-name]注意:对于使用动态 SA 的 IPsec 隧道,隧道目标地址必须位于默认互联网路由表 inet.0 中。
要完成 ES 隧道接口配置,请在相应的路由实例下包含 interface ES 接口的语句:
interface interface-name;
您可以在以下层级包含此语句:
[edit routing-instances routing-instance-name][edit logical-systems logical-system-name routing-instances routing-instance-name]
在 CE 路由器上配置 ES 隧道接口
要在 CE 路由器上配置 ES 隧道接口,请添加 unit 语句:
unit 0 {
tunnel {
source address;
destination address;
}
family inet {
address address;
ipsec-sa security-association-name;
}
}
您可以在以下层级包含此语句:
[edit interfaces interface-name][edit logical-systems logical-system-name interfaces interface-name]
在 PE 和 CE 路由器之间配置 ES 隧道接口
此示例说明如何在第 3 层 VPN 中配置 PE 路由器和 CE 路由器之间的 ES 隧道接口。此示例中使用的网络拓扑如 图 1 所示。
要配置此示例,请执行以下部分中的步骤:
在路由器 PE1 上配置 IPsec
在路由器 PE1 上配置 IP 安全 (IPsec):
[edit security]
ipsec {
security-association sa-esp-manual {
mode tunnel;
manual {
direction bidirectional {
protocol esp;
spi 16000;
authentication {
algorithm hmac-md5-96;
key ascii-text "$9$ABULt1heK87dsWLDk.P3nrevM7V24ZHkPaZ/tp0cSvWLNwgZUH";
}
encryption {
algorithm des-cbc;
key ascii-text "$9$/H8Q90IyrvL7VKMZjHqQzcyleLN";
}
}
}
}
}
配置不使用封装接口的路由实例
您可以在路由器 PE1 上配置路由实例,使用或不使用封装接口(t3-0/1/3 在本例中为 )。以下部分介绍如何在没有它的情况下配置路由实例:
在路由器 PE1 上配置路由实例
在路由器 PE1 上配置路由实例:
[edit routing-instances]
vpna {
instance-type vrf;
interface es-1/2/0.0;
route-distinguisher 10.255.14.174:1;
vrf-import vpna-import;
vrf-export vpna-export;
protocols {
bgp {
group vpna {
type external;
peer-as 100;
as-override;
neighbor 10.49.2.1;
}
}
}
}
在路由器 PE1 上配置 ES 隧道接口
在路由器 PE1 上配置 ES 隧道接口:
[edit interfaces es-1/2/0]
unit 0 {
tunnel {
source 192.168.197.249;
destination 192.168.197.250;
}
family inet {
address 10.49.2.2/30;
ipsec-sa sa-esp-manual;
}
}
配置ES隧道的封装接口
在此示例中,接口 t3-0/1/3 是 ES 隧道的封装接口。配置接口 t3-0/1/3:
[edit interfaces t3-0/1/3]
unit 0 {
family inet {
address 192.168.197.249/30;
}
}
使用封装接口配置路由实例
如果路由实例下也配置了隧道封装接口 t3-0/1/3、,则需要在接口定义下指定路由实例名称。系统使用此路由实例,通过手动安全关联搜索 IPsec 隧道的隧道目的地址。
以下章节说明如何使用封装接口配置路由实例:
在路由器 PE1 上配置路由实例
在路由器 PE1 上配置路由实例(包括隧道封装接口):
[edit routing-instances]
vpna {
instance-type vrf;
interface es-1/2/0.0;
interface t3-0/1/3.0;
route-distinguisher 10.255.14.174:1;
vrf-import vpna-import;
vrf-export vpna-export;
protocols {
bgp {
group vpna {
type external;
peer-as 100;
as-override;
neighbor 10.49.2.1;
}
}
}
}
在路由器 PE1 上配置 ES 隧道接口
在路由器 PE1 上配置 ES 隧道接口:
[edit interfaces es-1/2/0]
unit 0 {
tunnel {
source 192.168.197.249;
destination 192.168.197.250;
routing-instance {
destination vpna;
}
}
family inet {
address 10.49.2.2/30;
ipsec-sa sa-esp-manual;
}
}
在路由器 PE1 上配置封装接口
在路由器 PE1 上配置封装接口:
[edit interfaces t3-0/1/3]
unit 0 {
family inet {
address 192.168.197.249/30;
}
}
在路由器 CE1 上配置 ES 隧道接口
在路由器 CE1 上配置 ES 隧道接口:
[edit interfaces es-1/2/0]
unit 0 {
tunnel {
source 192.168.197.250;
destination 192.168.197.249;
}
family inet {
address 10.49.2.1/30;
ipsec-sa sa-esp-manual;
}
}
在路由器 CE1 上配置 IPsec
在路由器 CE1 上配置 IPsec:
[edit security]
ipsec {
security-association sa-esp-manual {
mode tunnel;
manual {
direction bidirectional {
protocol esp;
spi 16000;
authentication {
algorithm hmac-md5-96;
key ascii-text "$9$ABULt1heK87dsWLDk.P3nrevM7V24ZHkPaZ/tp0cSvWLNwgZUH";
}
encryption {
algorithm des-cbc;
key ascii-text "$9$/H8Q90IyrvL7VKMZjHqQzcyleLN";
}
}
}
}
}