Juniper MPLS L3VPN实验配置

本文最后更新于 2024年4月3日 晚上

实验说明

使用Juniper vMX进行实验。

ISIS L2 作为 IGP打通底层路由,LDP 作为公网MPLS标签分发,PE之间使用MP-IBGP

PS: 此文章只有PE的配置,用于学习和理解Juniper的MPLS VPN配置。

Juniper 系列文章:https://songxwn.com/categories/Juniper/

配置ISIS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
set interfaces lo0 unit 0 family inet address 192.168.0.1/32
set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00
# 配置ISO的 NET地址,用于ISIS
set protocols isis interface lo0.0 passive

set protocols isis level 2 wide-metrics-only
# 开启L2路由器的宽度量值计算
set protocols isis level 1 disable
# 关闭L1路由器
set interfaces ge-0/0/1 unit 0 family inet address 12.1.1.2/24
set interfaces ge-0/0/1 unit 0 family iso
# 开启物理接口的ISO,用于ISIS。

set protocols isis interface ge-0/0/1

# 宣告 物理接口

set protocols isis interface ge-0/0/1 point-to-point

# 配置邻居类型为P2P

set protocols isis interface ge-0/0/1 hello-padding disable

# 关闭Hello 报文填充

set protocols isis interface ge-0/0/1 level 2 metric 1000
# 配置ISIS 接口度量值

验证ISIS

show isis adjacency

#确认邻居状态为UP

show route protocol isis

#查看通过ISIS学习的路由表

配置LDP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
set protocols ldp interface all
set protocols ldp interface lo0.0

# 开启接口的LDP协议
set protocols mpls interface lo0.0
set protocols mpls interface all

# 开启接口的MPLS


set interfaces ge-0/0/9 unit 0 family mpls

# 开启接口的MPLS

验证LDP

show ldp session

##正常状态为: Operational

show route table inet.3

#查看公网LDP分配的标签。

PS: LDP转发路径完全依赖与IGP路由的选路,且FEC默认只会匹配/32路由建立LSP。

配置MP-BGP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
set routing-options router-id 1.1.1.1
# 配置全局的路由ID

set routing-options autonomous-system 100
# 配置全局的 AS号

set protocols bgp group RR type internal
# 建立BGP组,配置标签为IBGP

set protocols bgp group RR local-address 1.1.1.1
# 配置BGP的源IP为 Lookback 地址。

set protocols bgp group RR family inet unicast
set protocols bgp group RR family inet-vpn unicast
# 开启单播IPv4地址族,开启VPNv4地址族。

set protocols bgp group RR neighbor 4.4.4.4
# 配置BGP邻居。

验证BGP

show bgp neighbor

#查看BGP邻居

VRF配置

1
2
3
4
5
6
7
8
9
10
11
12
13
set routing-instances VLL-VPN1 instance-type vrf

# 配置路由实例标签为VRF
set routing-instances VLL-VPN1 interface ge-0/0/0.0

# 配置接口加入到路由实例
set routing-instances VLL-VPN1 route-distinguisher 100:1
set routing-instances VLL-VPN1 vrf-target target:100:1

#配置RD RT值,用于本地路由区分,和路由VRF的区分导入
set routing-instances VLL-VPN1 vrf-table-label

#为VRF里面的所有路由生成VPN MPLS标签

##在VRF路由表里面的,都会建立LSP发送路由到对端的MP-BGP邻居

验证VPN路由传递

show route table VLL-VPN1.inet

#查看VPN路由表,是否传递到对端PE。也可以查其分配的内网MPLS标签。

参考: https://supportportal.juniper.net/s/article/SRX-Example-Configuring-L3VPN-over-MPLS?language=en_US

配置BGP 反射器

反射器配置

1
2
3
4
set protocols bgp group RR cluster 2.2.2.2
#配置自己为路由反射器
set protocols bgp group RR neighbor 4.4.4.4
#与客户端建立对等体

客户端配置

1
2
set protocols bgp group RR neighbor 2.2.2.2
#与RR反射器建立对等体。

MPLS MTU / Jumbo frames 配置

由于多层的MPLS标签会占用有效负载大小,使默认的MTU 1500无法传输(MPLS的MTU会默认使用接口的MTU),所以要改大运营设备所有的接口帧大小和MTU。

MPLS标签栈象“垫层”一样,位于二层数据帧头和数据之间。在MPLS转发过程中,虽然网络层报文长度小于接口的MTU,但是增加MPLS标签后,报文长度可能超过链路层允许发送的范围,从而导致报文无法正常转发。为此,设备上定义了MPLS MTU,MPLS转发时将增加标签后的报文长度与MPLS MTU比较。报文长度大于MPLS MTU时,如果允许分片,则将报文分片后再进行转发;如果不允许分片,则直接丢弃。

参考

https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/topic-map/bgp-rr.html#id-understanding-bgp-route-reflectors

https://www.h3c.com/cn/d_200805/606207_30003_0.htm#_Toc227661962

https://zh.wikipedia.org/zh-hans/%E5%B7%A8%E5%9E%8B%E5%B8%A7

https://support.huawei.com/enterprise/zh/doc/EDOC1100138290/2edd846


Juniper MPLS L3VPN实验配置
https://songxwn.com/Juniper_L3-MPLS/
作者
Song
发布于
2022年9月30日
更新于
2024年4月3日
许可协议