Routing Protocol Support

Started by fabian, March 10, 2017, 11:11:53 PM

Previous topic - Next topic
Hi, I made a more or less working version of a plugin, that allows routing protocols like OSPF in OPNsense.
https://github.com/opnsense/plugins/pull/88

Quagga supports a lot more protocols but if you like to add another than OSPF like BGPv4 or RIP or are willing to help it could be even better.

Because it is a work in progress, it may not work on your device (the config still includes hardcoded interfaces because quagga generates them every time you copy the running config to the startup config and did not try if I can remove them securely.

Kind regards

Fabian

Hi Fabian,

This is very cool, thanks for doing this! :)


Cheers,
Franco

Hi,

I'm quite new to OPN but very familiar wit PF.
Searching for a solution to use OSPF and BGP and stumbled upon on this one.

Any way to help or test here?

I was planning to use just the CLI like in the doc (https://docs.opnsense.org/manual/how-tos/quagga.html) but if there's a GUI I fine too :)

You should use the CLI for now because it will not go into the next release (17.1.3) and the GUI will not provide the full functionality (only basic configuration)

I am not going to implement BGP as I have never used it and I have no idea how it works. The Plugin seems to generate a valid config but there is some unexpected behaviour in the framework for me :/

I can ask franco for a merge if you like.

I'm using BGP on Quagga (Linux) for years, also some minor stuff with OSPF.
Would love to help. :)

The code is now merged into the plugins repository. It will be possible to test it soon.

@Wordo: You may extend it by yourself (you can use the existing code as a template) or if anyone is willing to implement it, some configuration samples can help too (especially to know which configuration directives are important to you and therefore probably for others too).

Thanks! My test system is now OPNsense 17.7.a_213-amd64.

Will wait until the plugin will appear in the list, or do I have to add it by hand?



Meeep .. forget it. Cloned the plugin project beside core and installed it by hand.
Will start digging into it :)

I have seen that is is in the packages now.

It can be installed by typing "pkg install os-quagga-devel" into the shell.
Leave your comments  here for feedback or create a ticket in the GitHub repository opnsense/plugins which may mention me (@fabianfrz).

Kind regards

Fabian

Thanks! I didn't find the time yet to dive into coding standards.

Will setup a second machine on VBox and try the package.

Quote from: Wordo on March 17, 2017, 01:43:37 PM
Thanks! I didn't find the time yet to dive into coding standards.

Will setup a second machine on VBox and try the package.

Did a first pull request :)

The coding style is PSR1 and PSR2 for PHP, PEP8 for Python.

Hi,

do you know how we can handle the problem, that the named interfaces from OPNsense arent supported by the physical ones of quagga?

The UI offers only wan or lan, but on the system itself it's em0 and em1.

I didn't dive to deep in the code (and I'm far from good on coding), but is the $uuid responsible for selecting/finding the interface, like here:

https://github.com/opnsense/plugins/blob/master/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/OspfsettingsController.php


The uuid is required as an unique key for a field which contains multiple values (1:n association).

In Quagga it is possible to have an per interface configuration and because some settings (depending on the used routing protocol) apply to an interface we don't know, we cannot hardcode it.

UUID come from the model and have nothing to do with interfaces, except that interfaces in the OSPF configuration are managed via an ArrayField which has an UUID.

Here is the line which makes the uuid required:
https://github.com/opnsense/plugins/blob/master/net/quagga/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml#L67

Got you, thanks!

Ok, so I could rename the interfaces in UI to have the same name as system interface in order to prevent conflicts in the configuration, right?