Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: create a new namespace without duplicating frr configuration files #15696

Open
2 tasks done
ofergr opened this issue Apr 7, 2024 · 2 comments
Open
2 tasks done
Labels
triage Needs further investigation

Comments

@ofergr
Copy link

ofergr commented Apr 7, 2024

Description

My application allows a user to create a namespace with whichever mane he/she chooses. In this namespace, I want to run an instance of FRR.
When this happens, today I need to create a new folder under /etc/frr/ with the new namespace name and copy the configuration files from /erc/frr to the new subfolder. For each namespace, all the configuration files are the same. I am looking for a way to use the default configuration files under /etc/frr, load them to some memory location, and use them for each FRR instance I run, without the need to do file operations such as creating folders and copy files. Is there a way to do this today?

Version

FRRouting 9.1 (oferHPWork) on Linux(5.15.0-101-generic).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
    '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--localstatedir=/var/run/frr' '--sbindir=/usr/lib/frr' '--sysconfdir=/etc/frr' '--with-vtysh-pager=/usr/bin/pager' '--libdir=/usr/lib/x86_64-linux-gnu/frr' '--with-moduledir=/usr/lib/x86_64-linux-gnu/frr/modules' '--disable-dependency-tracking' '--enable-rpki' '--disable-scripting' '--enable-pim6d' '--with-libpam' '--enable-doc' '--enable-doc-html' '--enable-snmp' '--enable-fpm' '--disable-protobuf' '--disable-zeromq' '--enable-ospfapi' '--enable-bgp-vnc' '--enable-multipath=256' '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--enable-configfile-mask=0640' '--enable-logfile-mask=0640' 'build_alias=x86_64-linux-gnu' 'PYTHON=python3'
oferHPWork#

How to reproduce

try to create a new namespace and run FRR inside it (ip net exec net1 /usr/lib/frr/frrinit.sh start namespace). It will fail as it will not be able to find the configuration files under /etc/frr/namespace

Expected behavior

I would like not to create copies of configuration files for each FRR instance running in a namespace

Actual behavior

each FRR instance running in a separate namespace needs configuration files to be copied from /etc/frr

Additional context

No response

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.
@ofergr ofergr added the triage Needs further investigation label Apr 7, 2024
@ahmdzaki18
Copy link

You can add option -n on zebra in daemon file.
And each netns will be vrf on frr.conf.

@ofergr
Copy link
Author

ofergr commented Apr 9, 2024

Hi @ahmdzaki18 :
From the documenations:
-n, --vrfwnetns
When Zebra starts with this option, the VRF backend is based on Linux network namespaces. That implies that all network namespaces discovered by ZEBRA will create an associated VRF. The other daemons will operate on the VRF VRF defined by Zebra, as usual. If this option is specified when running Zebra, one must also specify the same option for mgmtd.

But zebra is running in each namespace. How can is see all the namespaces?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

2 participants