diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-09-26 18:49:59 +0200 |
---|---|---|
committer | Anuradha Karuppiah <anuradhak@cumulusnetworks.com> | 2020-08-18 18:25:06 +0200 |
commit | 07509878e37b7f6ce75e4168e450cee3b36f24e9 (patch) | |
tree | e22fc9a77bf37d4b442b52d87b3b11ab15e03f0b /zebra/zebra_ns.c | |
parent | Merge pull request #5702 from vishaldhingra/bgp_nb (diff) | |
download | frr-07509878e37b7f6ce75e4168e450cee3b36f24e9.tar.xz frr-07509878e37b7f6ce75e4168e450cee3b36f24e9.zip |
zebra: importation of bgp evpn rt5 from vni with other netns
With vrf-lite mechanisms, it is possible to create layer 3 vnis by
creating a bridge interface in default vr, by creating a vxlan interface
that is attached to that bridge interface, then by moving the vxlan
interface to the wished vrf.
With vrf-netns mechanism, it is slightly different since bridged
interfaces can not be separated in different network namespaces. To make
it work, the setup consists in :
- creating a vxlan interface on default vrf.
- move the vxlan interface to the wished vrf ( with an other netns)
- create a bridge interface in the wished vrf
- attach the vxlan interface to that bridged interface
from that point, if BGP is enabled to advertise vnis in default vrf,
then vxlan interfaces are discovered appropriately in other vrfs,
provided that the link interface still resides in the vrf where l2vpn is
advertised.
to import ipv4 entries from a separate vrf, into the l2vpn, the
configuration of vni in the dedicated vrf + the advertisement of ipv4
entries in bgp vrf will import the entries in the bgp l2vpn.
the modification consists in parsing the vxlan interfaces in all network
namespaces, where the link resides in the same network namespace as the
bgp core instance where bgp l2vpn is enabled.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/zebra_ns.c')
-rw-r--r-- | zebra/zebra_ns.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c index 4e5143733..4e23ca2f0 100644 --- a/zebra/zebra_ns.c +++ b/zebra/zebra_ns.c @@ -229,3 +229,25 @@ int zebra_ns_config_write(struct vty *vty, struct ns *ns) vty_out(vty, " netns %s\n", ns->name); return 0; } + +void zebra_ns_list_walk(int (*exec_for_each_zns)(struct zebra_ns *zns, + void *param_in, + void **param_out), + void *param_in, + void **param_out) +{ + struct ns *ns; + struct zebra_ns *zns; + int ret; + + RB_FOREACH (ns, ns_head, &ns_tree) { + zns = (struct zebra_ns *)ns->info; + if (!zns && ns->ns_id == NS_DEFAULT) + zns = zebra_ns_lookup(ns->ns_id); + if (!zns) + continue; + ret = exec_for_each_zns(zns, param_in, param_out); + if (ret == ZNS_WALK_STOP) + return; + } +} |