В данной статье рассмотрим конфигурацию MPLS c iBGP в качестве IGP, на примере L2VPN
Пример конфигурации:
router bgp 1 address-family ipv4 unicast exit bgp router-id 5.5.5.5 neighbor 10.0.0.2 address-family ipv4 unicast next-hop-self exit remote-as 1 send-community update-source 10.0.0.1 exit mpls forwarding interface loopback 1 interface tengigabitethernet 0/0/1 exit ldp exit discovery interface tengigabitethernet 0/0/1 bfd fast-detect exit neighbor 1.1.1.1 bfd fast-detect exit exit router-id 5.5.5.5 transport-address 5.5.5.5 exit l2vpn bridge-domain BD1 interface tengigabitethernet 0/0/2 exit pw 1.1.1.1 1122 pw-class class1 exit exit pw-class class1 encapsulation mpls signaling-type pseudowire-id-fec-signaling exit exit
При текущей конфигурации, мы увидим, что связность между маршрутизаторами установлена, сессия Target LDP поднялась, выделились сервисные метки, но Pseudo-Wire находится в состоянии "Lld", а транспортные метки LDP отсутствуют.
0/ME5200:R5# show route Mon Nov 20 02:35:36 2023 Codes: C - connected, S - static, O - OSPF, B - BGP, L - local IA - OSPF inter area, EA - OSPF intra area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, LE1 - IS-IS level1 external, LE2 - IS-IS level2 external BI - BGP internal, BE - BGP external, BV - BGP vpn, BL - BGP labeled, R - RIP B BI 1.1.1.1/32 via 10.0.0.2 [200/0], 02d17h37m, te0/0/1 <----- Loopback R1 изучен по iBGP L 5.5.5.5/32 is directly connected, 02d19h15m, lo1 C 10.0.0.0/24 is directly connected, 02d19h15m, te0/0/1 L 10.0.0.1/32 is directly connected, 02d19h15m, te0/0/1 Total entries: 5 0/ME5200:R5# show mpls ldp neighbors Mon Nov 20 02:36:04 2023 Peer Up/Down time Expires Adjcs Addrs Labels GR ----------------------- ------------- ---------- ------ ------ ------- --- 1.1.1.1:0 02d17h38m 37s 2 2 1 N <----- Активная сессия 0/ME5200:R5# show l2vpn bridge-domain detail Mon Nov 20 02:36:27 2023 MM -- mtu mismatch Up -- up GUp -- going up CM -- control-word mismatch Dn -- down GDn -- going down OL -- no outgoing label ST -- standby Lld -- lower layer down BK -- backup connection Fl -- failed Drm -- dormant SP -- static pseudowire SW -- switchover Bridge domain: BD1, state: up, bridge type: vpls MAC learning: enabled Local switching: enabled Flood replication point: egress Flooding Multicast: enabled Unknown unicast: enabled MAC aging time: 300 s, MAC limit: 4000, Action: enabled, MTU: 1500 Oper-status: up ACs: 1 (1 up) PWs: 1 (0 up) Routed interface: none List of ACs: AC: Tengigabitethernet0/0/2 AC binding status: up, Interface oper state: up List of PWs: PW: Neighbor 1.1.1.1, pw-id 1122, admin Up, oper Lld <----- Статус псевдопровода Status codes: PW class: class1, type: ethernet, signaling: pseudowire-id-fec-signaling PSN type: mpls, encapsulation: MPLS, control word: control-word-not-present Redundancy state unavailable Vpn index: 1, type: ls Created: 2023-11-17 07:20:26, last state change: 02d17h38m ago Local Remote Label 17 55 <----- Сервисные метки Group ID 0 0 MTU 1500 1500 Forwarding true true Customer-facing (ingress) recv fault false false Customer-facing (egress) send fault false false Local PSN-facing (ingress) recv fault false false Local PSN-facing (egress) send fault false false Switchover false false Interface description string rcv: none Remote capabilities: VC status can be signaled: false VCCV ID can be signaled : false Remote Control Channel (CC) supported: none Remote Connectivity Verification (CV) supported: none Remote node capability: Manually set PW: false Protocol has not yet finished cap. determination: false Signaling the pseudowire: true Sending the pseudowire: false List of VFIs: List of Autodiscovery PWs: 0/ME5200:R5# show mpls ldp forwarding <----- Транспортные метки отсутствуют Mon Nov 20 02:37:24 2023 Codes: R = Remote LFA FRR backup
Так как протокол BGP редко используется в качестве IGP и зачастую содержит большое количество маршрутов - для него, в отличии от других IGP протоколов, по умолчанию отключена редистрибуция маршрутов в ldp.
Для того чтобы транспортные метки выделились, необходим MPLS FEC.
Добавим в конфигурацию обоих маршрутизаторов редистрибуцию loopback адресов из BGP:
mpls ldp address-family ipv4 unicast redistribution bgp BGP match prefix 5.5.5.5/32 exit exit exit
mpls ldp address-family ipv4 unicast redistribution bgp BGP match prefix 1.1.1.1/32 exit exit exit
После внесения изменений у нас должны выделиться транспортные метки:
0/ME5200:R5# show mpls ldp forwarding Mon Nov 20 02:49:28 2023 Codes: R = Remote LFA FRR backup Prefix Label(s) out Outgoing Interface Next Hop flags --------------------- ------------- ------------------- --------------------- ------ 1.1.1.1/32 ImpNull te0/0/1 10.0.0.2 <----- Транспортная метка выделилась
А статус PW сменился с "Lld" на "UP":
0/ME5200:R5# show l2vpn bridge-domain detail Mon Nov 20 02:49:49 2023 MM -- mtu mismatch Up -- up GUp -- going up CM -- control-word mismatch Dn -- down GDn -- going down OL -- no outgoing label ST -- standby Lld -- lower layer down BK -- backup connection Fl -- failed Drm -- dormant SP -- static pseudowire SW -- switchover Bridge domain: BD1, state: up, bridge type: vpls MAC learning: enabled Local switching: enabled Flood replication point: egress Flooding Multicast: enabled Unknown unicast: enabled MAC aging time: 300 s, MAC limit: 4000, Action: enabled, MTU: 1500 Oper-status: up ACs: 1 (1 up) PWs: 1 (1 up) Routed interface: none List of ACs: AC: Tengigabitethernet0/0/2 AC binding status: up, Interface oper state: up List of PWs: PW: Neighbor 1.1.1.1, pw-id 1122, admin Up, oper Up <----- PW в статусе UP Status codes: PW class: class1, type: ethernet, signaling: pseudowire-id-fec-signaling PSN type: mpls, encapsulation: MPLS, control word: control-word-not-present Redundancy state active Vpn index: 1, type: ls Created: 2023-11-17 07:20:26, last state change: 00h00m53s ago Local Remote Label 17 55 Group ID 0 0 MTU 1500 1500 Forwarding true true Customer-facing (ingress) recv fault false false Customer-facing (egress) send fault false false Local PSN-facing (ingress) recv fault false false Local PSN-facing (egress) send fault false false Switchover false false Interface description string rcv: none Remote capabilities: VC status can be signaled: false VCCV ID can be signaled : false Remote Control Channel (CC) supported: none Remote Connectivity Verification (CV) supported: none Remote node capability: Manually set PW: false Protocol has not yet finished cap. determination: false Signaling the pseudowire: true Sending the pseudowire: false List of VFIs: List of Autodiscovery PWs:
Проверяем связность между R2 и R4:
0/ME5100:R2# ping 10.0.1.4 Mon Nov 20 03:10:39 2023 Sending 4, 56-byte ICMP Echos to 10.0.1.4, request send interval is 0.100 seconds, response wait timeout is 2.000 seconds: !!!! Success rate is 100 percent (4/4), round-trip min/avg/max = 0.120/0.163/0.190 ms