]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_routemap_nb.h
bgpd: add resolution for l3vpn traffic over gre interfaces
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 20 Sep 2021 09:50:52 +0000 (11:50 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 5 Sep 2022 20:26:25 +0000 (22:26 +0200)
commit1bb550b63ceb1809c069a81f1cbd74603c966fbb
tree08a8f04287cc27d1f4d374b058c2962d5e4c3851
parentf1f38efd836af248d362d961224a540d07bd50cf
bgpd: add resolution for l3vpn traffic over gre interfaces

When a route imported from l3vpn is analysed, the nexthop from default
VRF is looked up against a valid MPLS path. Generally, this is done on
backbones with a MPLS signalisation transport layer like LDP. Generally,
the BGP connection is multiple hops away. That scenario is already
working.

There is case where it is possible to run L3VPN over GRE interfaces, and
where there is no LSP path over that GRE interface: GRE is just here to
tunnel MPLS traffic. On that case, the nexthop given in the path does not
have MPLS path, but should be authorized to convey MPLS traffic provided
that the user permits it via a configuration command.

That commit introduces a new command that can be activated in route-map:
 > set l3vpn next-hop encapsulation gre

That command authorizes the nexthop tracking engine to accept paths that
o have a GRE interface as output, independently of the presence of an LSP
path or not.

A configuration example is given below. When bgp incoming vpnv4 updates
are received, the nexthop of NLRI is 192.168.0.2. Based on nexthop
tracking service from zebra, BGP knows that the output interface to reach
192.168.0.2 is r1-gre0. Because that interface is not MPLS based, but is
a GRE tunnel, then the update will be using that nexthop to be installed.

    interface r1-gre0
     ip address 192.168.0.1/24
    exit
    router bgp 65500
     bgp router-id 1.1.1.1
     neighbor 192.168.0.2 remote-as 65500
     !
     address-family ipv4 unicast
      no neighbor 192.168.0.2 activate
     exit-address-family
     !
     address-family ipv4 vpn
      neighbor 192.168.0.2 activate
      neighbor 192.168.0.2 route-map rmap in
     exit-address-family
    exit
    !
    router bgp 65500 vrf vrf1
     bgp router-id 1.1.1.1
     no bgp network import-check
     !
     address-family ipv4 unicast
      network 10.201.0.0/24
      redistribute connected
      label vpn export 101
      rd vpn export 444:1
      rt vpn both 52:100
      export vpn
      import vpn
     exit-address-family
    exit
    !
    route-map rmap permit 1
     set l3vpn next-hop encapsulation gre
    exit

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_attr.h
bgpd/bgp_nht.c
bgpd/bgp_routemap.c
bgpd/bgp_routemap_nb.c
bgpd/bgp_routemap_nb.h
bgpd/bgp_routemap_nb_config.c
doc/user/bgp.rst
doc/user/routemap.rst
lib/routemap.h
lib/routemap_cli.c
yang/frr-bgp-route-map.yang