OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • Routing Protocol Support
« previous next »
  • Print
Pages: [1] 2 3

Author Topic: Routing Protocol Support  (Read 12683 times)

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2740
  • Karma: 195
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Routing Protocol Support
« on: March 10, 2017, 11:11:53 pm »
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
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 12612
  • Karma: 1082
    • View Profile
Re: Routing Protocol Support
« Reply #1 on: March 11, 2017, 04:00:53 pm »
Hi Fabian,

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


Cheers,
Franco
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #2 on: March 13, 2017, 02:16:36 pm »
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 :)
Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2740
  • Karma: 195
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Routing Protocol Support
« Reply #3 on: March 13, 2017, 10:35:14 pm »
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.
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #4 on: March 14, 2017, 06:56:58 am »
I'm using BGP on Quagga (Linux) for years, also some minor stuff with OSPF.
Would love to help. :)
Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2740
  • Karma: 195
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Routing Protocol Support
« Reply #5 on: March 14, 2017, 02:05:20 pm »
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).
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #6 on: March 14, 2017, 02:38:44 pm »
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?


 
Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #7 on: March 14, 2017, 03:31:40 pm »
Meeep .. forget it. Cloned the plugin project beside core and installed it by hand.
Will start digging into it :)
Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2740
  • Karma: 195
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Routing Protocol Support
« Reply #8 on: March 16, 2017, 10:26:27 pm »
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
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #9 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.
Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #10 on: March 20, 2017, 04:24:30 pm »
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 :)
Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2740
  • Karma: 195
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Routing Protocol Support
« Reply #11 on: March 20, 2017, 06:01:31 pm »
The coding style is PSR1 and PSR2 for PHP, PEP8 for Python.
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #12 on: March 22, 2017, 11:23:04 am »
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

Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2740
  • Karma: 195
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Routing Protocol Support
« Reply #13 on: March 22, 2017, 11:33:11 am »
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
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6094
  • Karma: 420
    • View Profile
Re: Routing Protocol Support
« Reply #14 on: March 22, 2017, 01:53:25 pm »
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?
Logged
IRC: mimugmail
Twitter: mimu_muc
WWW: www.routerperformance.net
Commercial Plugins (German): https://opnsense.max-it.de/

  • Print
Pages: [1] 2 3
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • Routing Protocol Support
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2022 All rights reserved
  • SMF 2.0.18 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2