华为MPLS跨域A、B方案实验配置
目录
MPLS域内配置
MPLS-AS100域内配置
MPLS-AS200域内配置
域间方式A配置
ASBR4和ASBR5配置实例
ASBR之间建立基于实例的EBGP邻居关系
域间方式B配置
ASBR相连接口开启MPLS
ASBR之间建立MP-BGP的EBGP邻居
配置取消RT值检测
配置传递路由时更改下一跳为自身
MPLS域内配置
方案A、B的域内配置就同MPLS单域配置
只不过PE与PE的MP-BGP邻居关系变为PE与ASBR之间的MP-BGP邻居关系
MPLS-AS100域内配置
PE2配置
配置接口IP地址以及IGP协议
int g0/0/0 ip add 100.0.23.2 24 int g0/0/1 ip add 100.0.12.2 24 int loop 0 ip add 2.2.2.2 32 isis 1 net 49.0001.0000.0002.00 int g0/0/0 isis enable 1 int loop 0 isis enable 1
配置LDP协议
mpls lsr-id 2.2.2.2 mpls mpls ldp int g0/0/0 mpls mpls ldp
配置MP-BGP邻居(与ASBR4建立IBGP的MP-BGP)
bgp 100 peer 4.4.4.4 as 100 peer 4.4.4.4 con loop 0 ipv4-family unicast undo peer 4.4.4.4 enable ipv4-family vpnv4 peer 4.4.4.4 enable
配置与CE对接的实例与路由协议
ip vpn-instance CE1 ipv4-family route-distinguisher 12:1 vpn-target 200:1 export-extcommunity vpn-target 100:1 import-extcommunity int g0/0/1 ip bind vpn-instance CE1 ip add 100.0.12.2 24 ospf 1 vpn-instance CE1 area 0 net 100.0.12.2 0.0.0.0
配置将CE的路由引入到BGP中
bgp 100 ipv4-family vpn-instance CE1 import-route ospf 1
配置将BGP路由引入到CE中
ospf 1 import-route bgp
P3配置
配置接口IP地址以及IGP协议
int g0/0/0 ip add 100.0.23.3 24 int g0/0/1 ip add 100.0.34.3 24 int loop 0 ip add 3.3.3.3 32 isis 1 net 49.0001.0000.0003.00 int g0/0/0 isis enable 1 int g0/0/1 isis enable 1 int loop 0 isis enable 1
配置LDP协议
mpls lsr-id 3.3.3.3 mpls mpls ldp int g0/0/0 mpls mpls ldp int g0/0/1 mpls mpls ldp
ASBR4配置
配置接口IP地址以及IGP协议
int g0/0/0 ip add 100.0.34.4 24 int g0/0/1 ip add 100.0.45.4 24 int loop 0 ip add 4.4.4.4 32 isis 1 net 49.0001.0000.0004.00 int g0/0/0 isis enable 1 int loop 0 isis enable 1
配置LDP协议
mpls lsr-id 4.4.4.4 mpls mpls ldp int g0/0/0 mpls mpls ldp
配置MP-BGP邻居(与PE2建立IBGP的MP-BGP)
bgp 100 peer 2.2.2.2 as 100 peer 2.2.2.2 con loop 0 ipv4-family unicast undo peer 2.2.2.2 enable ipv4-family vpnv4 peer 2.2.2.2 enable
此时在PE上可以查看VPNV4路由,发现已经存在本地CE的路由了
但是在ASBR上还没有收到Vpnv4路由(需要在ASBR配置实例,匹配RD值接收Vpnv4路由)
Dis bgp vpnv4 all routing-table
Dis bgp vpnv4 all peer
MPLS-AS200域内配置
PE7配置
配置接口IP地址以及IGP协议
int g0/0/0 ip add 100.0.67.7 24 int g0/0/1 ip add 100.0.78.7 24 int loop 0 ip add 7.7.7.7 32 isis 1 net 49.0001.0000.0007.00 int g0/0/0 isis enable 1 int loop 0 isis enable 1
配置LDP协议
mpls lsr-id 7.7.7.7 mpls mpls ldp int g0/0/0 mpls mpls ldp
配置MP-BGP邻居(与ASBR5建立IBGP的MP-BGP)
bgp 200 peer 5.5.5.5 as 200 peer 5.5.5.5 con loop 0 ipv4-family unicast undo peer 5.5.5.5 enable ipv4-family vpnv4 peer 5.5.5.5 enable
配置与CE对接的实例与路由协议
ip vpn-instance CE8 ipv4-family route-distinguisher 78:1 vpn-target 400:1 export-extcommunity vpn-target 300:1 import-extcommunity int g0/0/1 ip bind vpn-instance CE8 ip add 100.0.78.7 24 ospf 1 vpn-instance CE8 area 0 net 100.0.78.7 0.0.0.0
配置将CE的路由引入到BGP中
bgp 200 ipv4-family vpn-instance CE8 import-route ospf 1
配置将BGP路由引入到CE中
ospf 1 import-route bgp
P6配置
配置接口IP地址以及IGP协议
int g0/0/0 ip add 100.0.67.6 24 int g0/0/1 ip add 100.0.56.6 24 int loop 0 ip add 6.6.6.6 32 isis 1 net 49.0001.0000.0006.00 int g0/0/0 isis enable 1 int g0/0/1 isis enable 1 int loop 0 isis enable 1
配置LDP协议
mpls lsr-id 6.6.6.6 mpls mpls ldp int g0/0/0 mpls mpls ldp int g0/0/1 mpls mpls ldp
ASBR5配置
配置接口IP地址以及IGP协议
int g0/0/0 ip add 100.0.56.5 24 int g0/0/1 ip add 100.0.45.5 24 int loop 0 ip add 5.5.5.5 32 isis 1 net 49.0001.0000.0005.00 int g0/0/0 isis enable 1 int loop 0 isis enable 1
配置LDP协议
mpls lsr-id 5.5.5.5 mpls mpls ldp int g0/0/0 mpls mpls ldp
配置MP-BGP邻居(与PE7建立IBGP的MP-BGP)
bgp 200 peer 7.7.7.7 as 200 peer 7.7.7.7 con loop 0 ipv4-family unicast undo peer 7.7.7.7 enable ipv4-family vpnv4 peer 7.7.7.7 enable
Dis bgp vpnv4 all routing-table
Dis bgp vpnv4 all peer
域间方式A配置
MPLS隧道——跨域解决方案A、B讲解_mpls 跨域_静下心来敲木鱼的博客-CSDN博客https://blog.csdn.net/m0_49864110/article/details/127601807?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167383860516782425185242%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=167383860516782425185242&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-3-127601807-null-null.blog_rank_default&utm_term=mpls%E8%B7%A8%E5%9F%9F&spm=1018.2226.3001.4450
方式A:在ASBR4和ASBR5上建立基于实例的EBGP邻居,将Vpnv4路由转为IPv4路由传递到其它域中(即将ASBR看作PE来配置)
实例对应关系(PE与ASBR的实例对应)
ASBR4和ASBR5配置实例
ASBR4的实例需要接收CE1的vpnv4路由
ip vpn-instance CE1
ipv4-family
route-distinguisher 12:4
vpn-target 100:1 export-extcommunity
vpn-target 200:1 import-extcommunity
int g0/0/1
ip bind vpn-instance CE1
ip add 100.0.45.4 24
ASBR5的实例需要接收CE8的vpnv4路由
ip vpn-instance CE8
ipv4-family
route-distinguisher 78:5
vpn-target 300:1 export-extcommunity
vpn-target 400:1 import-extcommunity
int g0/0/1
ip bind vpn-instance CE8
ip add 100.0.45.5 24
ASBR之间建立基于实例的EBGP邻居关系
ASBR4
bgp 100
ipv4-family vpn-instance CE1
peer 100.0.45.5 as 200
ASBR5
bgp 200
ipv4-family vpn-instance CE8
peer 100.0.45.4 as 100
dis bgp vpnv4 vpn-instance CE1 peer 查看实例CE1的BGP邻居
此时在ASBR设备查看Vpnv4路由信息,在CE查看路由信息
域间方式B配置
方式B:在ASBR4和ASBR5上建立VPNV4的EBGP邻居,直接将VPNV4路由传递给对端
基础配置只是PE1与PE7上的的实例有不同,其余都相同(即PE之间的实例需要对应)
绿色为ASBR4配置,紫色为ASBR5配置
ASBR相连接口开启MPLS
int g0/0/1
mpls
int g0/0/1
mpls
ASBR之间建立MP-BGP的EBGP邻居
bgp 100
peer 100.0.45.5 as 200
ipv4-family unicast
undo peer 100.0.45.5 enable
ipv4-family vpnv4
peer 100.0.45.5 enable
bgp 200
peer 100.0.45.4 as 100
ipv4-family unicast
undo peer 100.0.45.4 enable
ipv4-family vpnv4
peer 100.0.45.4 enable
配置取消RT值检测
由于ASBR上没有配置实例,所以需要在ASBR上配置取消RT值检测
bgp 100
ipv4-family vpnv4
undo policy vpn-target
bgp 200
ipv4-family vpnv4
undo policy vpn-target
配置传递路由时更改下一跳为自身
由于从EBGP收到的路由传递给IBGP时,默认不会更改下一跳
bgp 100
ipv4-family vpnv4
peer 2.2.2.2 next-hop-local
bgp 200
ipv4-family vpnv4
peer 7.7.7.7 next-hop-local