ppp icon indicating copy to clipboard operation
ppp copied to clipboard

Add VRF binding support

Open c-po opened this issue 4 years ago • 8 comments

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.

c-po avatar Aug 20 '21 08:08 c-po

@paulusmack, @enaess: What do you think?

Neustradamus avatar Aug 20 '21 21:08 Neustradamus

Sounds reasonable. Do you have a patch?

paulusmack avatar Aug 21 '21 02:08 paulusmack

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);

c-po avatar Aug 21 '21 07:08 c-po

@c-po: Have you looked?

Neustradamus avatar Mar 29 '22 00:03 Neustradamus

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

c-po avatar Mar 29 '22 05:03 c-po