]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: Allow overriding MPLS VPN next-hops via route-maps
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 18 Nov 2022 13:47:50 +0000 (15:47 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 18 Nov 2022 14:17:15 +0000 (16:17 +0200)
commit6eeb9255450020cb90abf2d4e7de6c31a646e609
treeb933b00b4513dd43d451962823455de9e101d3d5
parent9a84cb612e8532d6f14d4702ecd9dfd6af408be5
bgpd: Allow overriding MPLS VPN next-hops via route-maps

Just do not reset next-hop for MPLS VPN routes.

Example of 172.16.255.1/32 (using extended next-hop capability):

```
pe2# sh bgp ipv4 vpn
BGP table version is 4, local router ID is 10.10.10.20, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 192.168.1.2:2
 *>i10.0.0.0/24      2001:db8:1::1            0    100      0 65000 ?
    UN=2001:db8:1::1 EC{192.168.1.2:2} label=1111 type=bgp, subtype=0
 *>i172.16.255.1/32  2001:db8::1              0    100      0 65000 ?
    UN=2001:db8::1 EC{192.168.1.2:2} label=1111 type=bgp, subtype=0
 *>i192.168.1.0/24   2001:db8:1::1            0    100      0 65000 ?
    UN=2001:db8:1::1 EC{192.168.1.2:2} label=1111 type=bgp, subtype=0
 *>i192.168.2.0/24   2001:db8:1::1                 100      0 65000 ?
    UN=2001:db8:1::1 EC{192.168.1.2:2} label=1111 type=bgp, subtype=0
Route Distinguisher: 192.168.2.2:2
 *> 10.0.0.0/24      192.168.2.1@4<           0     50      0 65000 ?
    UN=192.168.2.1 EC{192.168.2.2:2} label=2222 type=bgp, subtype=5
 *> 172.16.255.1/32  192.168.2.1@4<                 50      0 65000 ?
    UN=192.168.2.1 EC{192.168.2.2:2} label=2222 type=bgp, subtype=5
 *> 192.168.1.0/24   192.168.2.1@4<                 50      0 65000 ?
    UN=192.168.2.1 EC{192.168.2.2:2} label=2222 type=bgp, subtype=5
 *> 192.168.2.0/24   192.168.2.1@4<           0     50      0 65000 ?
    UN=192.168.2.1 EC{192.168.2.2:2} label=2222 type=bgp, subtype=5

Displayed  8 routes and 8 total paths
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_attr.h
bgpd/bgp_routemap.c
bgpd/bgp_updgrp.h
bgpd/bgp_updgrp_packet.c