This article illustrates the change in behavior of Label Distribution Protocol (LDP) Egress Policy for routes that are received from BGP Labeled Unicast (LU). Beginning with Junos 16.1, LDP Egress Policy does not work if the route is learned from BGP Labeled Unicast.
Consider the following topology:
inet.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 4.4.4.4/32 *[OSPF/10] 00:49:31, metric 1 > to 100.0.34.4 via ge-0/0/3.10 inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 4.4.4.4/32 *[LDP/9] 00:49:28, metric 1 > to 100.0.34.4 via ge-0/0/3.10
Input label database, 3.3.3.3:0--4.4.4.4:0 Labels received: 2 Label Prefix 299776 3.3.3.3/32 3 4.4.4.4/32 Output label database, 3.3.3.3:0--4.4.4.4:0 Labels advertised: 2 Label Prefix 3 3.3.3.3/32 299776 4.4.4.4/32
inet.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 4.4.4.4/32 Self 1 I inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 4.4.4.4/32 Self 1 I
inet.0: 16 destinations, 16 routes (16 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 4.4.4.4/32 3.3.3.3 1 65002 I inet.3: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 4.4.4.4/32 3.3.3.3 1 65002 I mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
Input label database, 2.2.2.2:0--1.1.1.1:0 Labels received: 2 Label Prefix 3 1.1.1.1/32 299808 2.2.2.2/32 Output label database, 2.2.2.2:0--1.1.1.1:0 Labels advertised: 2 Label Prefix 299808 1.1.1.1/32 3 2.2.2.2/32 3 10.102.176.0/20 3 100.0.12.0/24 3 100.0.23.0/24
set protocols ldp egress-policy test set protocols ldp interface ge-0/0/1.0 set protocols ldp interface fxp0.0 disable set protocols ldp interface lo0.0 set policy-options policy-statement test term 10 from protocol bgp set policy-options policy-statement test term 10 from rib inet.3 set policy-options policy-statement test term 10 then accept set policy-options policy-statement test term 20 from interface lo0.0 set policy-options policy-statement test term 20 then accept
inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 224.0.0.2/32 *[LDP/9] 01:23:12, metric 1 MultiRecv inet.3: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden) <<<<<<<<< no 4.4.4.4 route is seen. + = Active Route, - = Last Active, * = Both 2.2.2.2/32 *[LDP/9] 01:14:58, metric 1 > to 100.0.12.2 via ge-0/0/1.0 mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 299808 *[LDP/9] 01:14:58, metric 1 > to 100.0.12.2 via ge-0/0/1.0, Pop 299808(S=0) *[LDP/9] 01:14:58, metric 1 > to 100.0.12.2 via ge-0/0/1.0, Pop
Beginning with Junos 16.1, LDP Egress Policy will not consider BGP LU routes in inet.3 for policy processing. As a result, LU routes will not be advertised despite a matching condition in a policy. To resolve this issue, the inet.3 route in R2 should be copied to inet.0. Then the egress-policy is to be applied to redistribute this BGP LU route to R1 as follows:
set routing-options rib-groups inet3-to-inet0 import-rib inet.3 set routing-options rib-groups inet3-to-inet0 import-rib inet.0 set routing-options rib-groups inet3-to-inet0 import-policy TEST set policy-options policy-statement TEST term 1 from route-filter 4.4.4.4/32 exact set policy-options policy-statement TEST term 1 then accept
set protocols bgp group ebgp family inet labeled-unicast rib-group inet3-to-inet0
set policy-options policy-statement BGP-LDP term 1 from protocol bgp set policy-options policy-statement BGP-LDP term 1 from rib inet.0 set policy-options policy-statement BGP-LDP term 1 then accept set policy-options policy-statement BGP-LDP term 2 from interface lo0.0 set policy-options policy-statement BGP-LDP term 2 the accept
set protocols ldp egress-policy BGP-LDP
inet.3: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2.2.2.2/32 *[LDP/9] 00:04:57, metric 1 > to 100.0.12.2 via ge-0/0/1.0 4.4.4.4/32 *[LDP/9] 00:00:27, metric 1 > to 100.0.12.2 via ge-0/0/1.0