OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • How to setup and manage 18+ OpnSense centralized
« previous next »
  • Print
Pages: [1]

Author Topic: How to setup and manage 18+ OpnSense centralized  (Read 7655 times)

Schroeffu

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
How to setup and manage 18+ OpnSense centralized
« on: April 29, 2018, 02:59:36 pm »
Hi all,

i have a use-case where 18+ locations needs to be connected to their local DSL connection for white proxy internet usage. A Firewall like OpnSense should work as a WebProxy for all the users on site. In Future maybe the guest-wifi-coupon solution will be added for guests. This locations are connected to each other through MPLS but the standard internet browser traffic should not go via main location due to bandwith limitations when everybody is streaming ;-) So means, 18+ OpnSense's needs to be managed  cenralized and with automated roll-outs of their configs.

Is the API ready to use to configure OpnSense after installation? In that case an ansible playbook can do it. A CLI is easyier but a fully working API will do it too.

If not, whats the way to configure & manage 18+ OpnSense Installations? For sure i  dont want click through 18+ WebUIs for any change.. ;-)

So, whats the best practice here :-)?

Best Regards
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: How to setup and manage 18+ OpnSense centralized
« Reply #1 on: April 29, 2018, 05:42:19 pm »
Quote from: Schroeffu on April 29, 2018, 02:59:36 pm
Hi all,

i have a use-case where 18+ locations needs to be connected to their local DSL connection for white proxy internet usage. A Firewall like OpnSense should work as a WebProxy for all the users on site. In Future maybe the guest-wifi-coupon solution will be added for guests. This locations are connected to each other through MPLS but the standard internet browser traffic should not go via main location due to bandwith limitations when everybody is streaming ;-) So means, 18+ OpnSense's needs to be managed  cenralized and with automated roll-outs of their configs.

Quote from: Schroeffu on April 29, 2018, 02:59:36 pm
Is the API ready to use to configure OpnSense after installation? In that case an ansible playbook can do it. A CLI is easyier but a fully working API will do it too.
The API is available for some core things (captive portal, proxy, ips, static routes) and most plugins. Most things in core is not API capable. If the page you open has the "/ui" prefix, there is very likely an API behind.

Quote from: Schroeffu on April 29, 2018, 02:59:36 pm
If not, whats the way to configure & manage 18+ OpnSense Installations? For sure i  dont want click through 18+ WebUIs for any change.. ;-)
API if possible, generate and upload the config.xml, edit config.xml remotely and update the services using a cron job or use something like selenium.

Quote from: Schroeffu on April 29, 2018, 02:59:36 pm
So, whats the best practice here :-)?
If possible, use the API - it is the most simple way to work (single HTTP request).
Logged

Schroeffu

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: How to setup and manage 18+ OpnSense centralized
« Reply #2 on: May 01, 2018, 03:36:11 am »
Thanks for the answer.

Most sites do have the /ui in their URL. But where is the API Documentation?

I only could find a very basic example at https://docs.opnsense.org/development/how-tos/api.html
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: How to setup and manage 18+ OpnSense centralized
« Reply #3 on: May 01, 2018, 10:15:16 am »
There is no API documentation. You can find the endpoints and how to use them with the network tab of the developer tools of the browser.
Logged

fvanroie

  • Newbie
  • *
  • Posts: 20
  • Karma: 10
    • View Profile
    • PS_OPNsense
Re: How to setup and manage 18+ OpnSense centralized
« Reply #4 on: May 01, 2018, 11:15:04 am »
Your best chance is to scrape the source code. I have compiled a list of api commands from the source code here.

If you have PowerShell you can take a look at my PowerShell Module PS_OPnsense that's in the works. It's purpose is to automate OPNsense management. PowerShell Core 6 is cross-platform as well. If you are looking for specific functionality I might be able to include that.

There are some ruby and cli api clients out there as well.
Logged

chris968

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: How to setup and manage 18+ OpnSense centralized
« Reply #5 on: May 07, 2018, 01:20:58 pm »
I'm facing the same problem, i'm currently trying to integrate OPNSense at my new company but i'm probably going roll back to something more integrable with Ansible like CentOS + FirewallD or Shorewall because the API is not complete and/or there is no CLI to create rules and nat.
My second problem is that the hotplug of Virtio NIC seems not working under OPNSense, because of FreeBSD i suppose.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13956
  • Karma: 1210
    • View Profile
Re: How to setup and manage 18+ OpnSense centralized
« Reply #6 on: May 07, 2018, 06:53:39 pm »
Quote from: fabian on May 01, 2018, 10:15:16 am
There is no API documentation. You can find the endpoints and how to use them with the network tab of the developer tools of the browser.

That's no longer true. ;)

https://docs.opnsense.org/development/api.html
Logged

JohnDoe17

  • Newbie
  • *
  • Posts: 37
  • Karma: 5
    • View Profile
Re: How to setup and manage 18+ OpnSense centralized
« Reply #7 on: May 16, 2018, 09:39:33 pm »
I am very, very interested in this topic as well.  Have you been able to make any progress on this front using the API?

Question for Opnsense developer's:  What would it take to make this use case a higher priority?  Do you accept private contracts to prioritize work?  Or, in other words, what drives the priorities for developing new features?

Thanks!
« Last Edit: May 16, 2018, 09:45:09 pm by JohnDoe17 »
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13956
  • Karma: 1210
    • View Profile
Re: How to setup and manage 18+ OpnSense centralized
« Reply #8 on: May 17, 2018, 07:49:41 am »
The API effort is a huge task so we prioritise by user requests, usability and (unfortunately) technically sensible ordering. Sometimes we cannot add an API on top of a subsystem that does not adhere to a proper way of modelling its input and output.

Meanwhile work has started to write an API for the firewall aliases which should hit 18.7. :)

If you are willing to help move things along quicker please contact project@opnsense.org


Thank you,
Franco
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • How to setup and manage 18+ OpnSense centralized
 

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