You enable stitching of routes between the LDP and BGP by configuring separately tunnel table route export policies in both protocols and enabling the advertising of RFC 3107 formatted labeled routes for prefixes learned from LDP FECs.
The route export policy in BGP instructs BGP to listen to LDP route entries in the CPM tunnel table. If a /32 LDP FEC prefix matches an entry in the export policy, BGP originates a BGP labeled route, stitches it to the LDP FEC, and re-distributes the BGP labeled route to its IBGP neighbors.
The user adds LDP FEC prefixes with the statement ‛from protocol ldp’ in the configuration of the existing BGP export policy at the global level, the peer-group level, or at the peer level using the commands:
config>router>bgp>export policy-name
config>router>bgp>group>export policy-name
config>router>bgp>group>neighbor>export policy-name
To indicate to BGP to evaluate the entries with the ‛from protocol ldp’ statement in the export policy when applied to a specific BGP neighbor, use commands:
config>router>bgp>group>neighbor>family label-ipv4
config>router>bgp>group>neighbor>advertise-ldp-prefix
Without this, only core IPv4 routes learned from RTM are advertised as BGP labeled routes to this neighbor. And the stitching of LDP FEC to the BGP labeled route is not performed for this neighbor even if the same prefix was learned from LDP.
The tunnel table route export policy in LDP instructs LDP to listen to BGP route entries in the CPM Tunnel Table. If a /32 BGP labeled route matches a prefix entry in the export policy, LDP originates an LDP FEC for the prefix, stitches it to the BGP labeled route, and re-distributes the LDP FEC its IBGP neighbors.
The user adds BGP labeled route prefixes with the statement ‛from protocol bgp’ in the configuration of a new LDP tunnel table export policy using the command:
config>router>ldp>export-tunnel-table policy-name.
The ‛from protocol’ statement has an effect only when the protocol value is ldp. Policy entries with protocol values of rsvp, bgp, or any value other than ldp are ignored at the time the policy is applied to LDP.