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?
The GUI shows the names visible in the interface section (for example lan) but the real interface names like em0 are stored in the backend.
But in the ospf.conf there's a passive interface lan for example, I'm more familiar within linux, so I'm not sure if this is correct?
you can configure any interface as a passive interface. This is a CSV field which is spit by ",". See: https://github.com/fabianfrz/plugins/blob/master/net/quagga/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf#L34
BTW: OPNsense is a FreeBSD, not Linux.
I tried to set the IF by hand but the results were not saved.
Surely it's BSD, that's why I'm a bit clumsy ;D
Hi,
do you know if there will be a 0.0.2 release pkg?
Thanks!
No there will be a 0.0.2-dev with the next release but you can install it via pkg. Note that is will still not pull in quagga as a dependency - this will be in 0.0.3.
Little Update: 0.0.3 will support RIPv1 and RIPv2 too.
Cool! :)
I always do a pkg update and pkg search quagga, but there's only the 0.0.1 version.
Hi Wordo,
We only refresh the mirrors (including the plugins) on a release build. If you upgrade to 17.1.4 the latest version of the plugin will be applied automatically.
I don't recommend pkg upgrade -- it mostly works, but will miss reboots and FreeBSD updates.
Cheers,
Franco
Got it, thanks! :)
Hi,
I'm currently working on a bgp setup page but when I enable the service and press save there's nothing. Also the values won't get saved.
How can I debug the insights on opnsense? Had a short look on the dev guide but didn't found anything.
If you like I could send a pull request for review if you're interested.
Did you add the correct JavaScript to the view?
BTW: You can always create a pull request but please prefix it with [WIP] so nobody will merge it.
Just some news for you: Will be released soon.
Yep, had a look at #115.
But I'm still not sure if the interface detection really works.
When I connect via vtysh I can see all my physical interfaces like em0, em1 ... but when I set passive interface in OSPF, it's written as "wan" in the config. I haven't tried this out yet, but are you sure this will work correctly?
Looks like there is something wrong. I will ask Franco for the issue.
ATM for me it only works if I rename the IFs in OPNsense to my physical ones.
OT: Is there some kind of IRC where you guys are available?
a chennel on freenode: #opnsense
Good news for users of BGP: Another user contributed basic BGP support:
https://github.com/opnsense/plugins/pull/112
https://github.com/opnsense/plugins/pull/121
It will be in devel version of the quagga plugin, which is released with the next version of OPNsense (17.1.5).
Feedback and pull requests are welcome.
Have a nice easter weekend!
Fabian
BGP will be supported in the next version. (17.1.6) - developer preview users can test some diagnostics pages.
The development will also include OSPFv3 (for IPv6) - 17.1.7
If you are still reading this: the developer preview may include OSPFv3 (by michael) and a diagnostics page (by me).
Any info about BGP ipv6?
I can try to get this working in two weeks ...