ppp-project / ppp

Paul's PPP Package: PPP daemon and associated utilities | Official GitHub repo: https://github.com/ppp-project/ppp
https://github.com/ppp-project/ppp
Other
389 stars 231 forks source link

Add VRF binding support #311

Open c-po opened 3 years ago

c-po commented 3 years ago

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 commented 3 years ago

@paulusmack, @enaess: What do you think?

paulusmack commented 3 years ago

Sounds reasonable. Do you have a patch?

c-po commented 3 years ago

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.

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 commented 2 years ago

@c-po: Have you looked?

c-po commented 2 years ago

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 commented 3 months ago

@EasyNetDev: Can you look it?

EasyNetDev commented 3 months ago

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.