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

Add VRF binding support #311

Open
c-po opened this issue Aug 20, 2021 · 7 comments
Open

Add VRF binding support #311

c-po opened this issue Aug 20, 2021 · 7 comments

Comments

@c-po
Copy link

c-po commented Aug 20, 2021

Hi Paul,

I am one of the mainters of VyOS an open source, Linux (Debian) based network operating system. We utilize pppd to provide dial-up (pppoe) connections for the users. We have added VRF support in our upcoming 1.3 release by using ip-up/ip-down scripts to move an interface into the appropriate VRF - that somehow works but could be nicer.

Why?

The flakyness now comes into play when routes should be installed by pppd, pppd will always install the route into the main routing table - no problem - we can workaround this in an ip-up/down helper, too.

Feature Request

Could a new configuration item named vrf be added into the peer configuration file? If that vrf is defined, and the vrf exists, pppd can then automatically assign the interface into the appropriate VRF without the need for additional external helpers.

@Neustradamus
Copy link
Member

@paulusmack, @enaess: What do you think?

@paulusmack
Copy link
Collaborator

Sounds reasonable. Do you have a patch?

@c-po
Copy link
Author

c-po commented Aug 21, 2021

I do not have a patch but I would provide one. As I am not familiar with the codebase maybe you can point me to the file which needs to be extended.

  • I would implement this only for Linux
  • I would name the config option for the peer file vrf which defaults to master which is the Linux default.
  • VRF assignment must be done prior to installing routes, as they nedd to go into the appropriate VRF.

From https://www.kernel.org/doc/Documentation/networking/vrf.txt

Applications
------------
Applications that are to work within a VRF need to bind their socket to the
VRF device:

    setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);

@Neustradamus
Copy link
Member

@c-po: Have you looked?

@c-po
Copy link
Author

c-po commented Mar 29, 2022

Hi @Neustradamus,

I have workarounded the issue by calling a custom script which does all the VRF handling once the interface was dialed. IMHO not that nice but it works

@Neustradamus
Copy link
Member

@EasyNetDev: Can you look it?

@EasyNetDev
Copy link
Contributor

Hi all,

I can take a look in the near future for a patch. Now I'm busy with creating a script to build custom Debian OS for Banana Pi R4 and not only.

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

No branches or pull requests

4 participants