OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • Adding Rule after plugin installation
« previous next »
  • Print
Pages: [1]

Author Topic: Adding Rule after plugin installation  (Read 3871 times)

Lord_Pinhead

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Adding Rule after plugin installation
« on: August 22, 2018, 04:23:55 pm »
Hi,

i started with Opnsense and need 2 Services for my LAN. So i thought about creating an plugin for them.
The first one is check_mk with (x)inetd and the second is vlmcsd, and KMS Emulator for my lab installations.

So for both of them i need to add Rules to the specified Interfaces to allow certain traffic and i need in the second case an DNS Setting in DNSMasq.

Are there any code examples i could use? Or should i use the API for it, and if yes, i still need an example for it :-)

--
Lord_Pinhead
Logged

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Adding Rule after plugin installation
« Reply #1 on: August 22, 2018, 06:46:41 pm »
the package for vlmcsd is very likely not in the repository but you can build it by hand (if your legal department says that it is ok - looks problematic in my opinion), check_mk probably is, inetd may be preinstalled.

If you want to create a plugin, you can find the instructions here: https://docs.opnsense.org/development/examples/helloworld.html

The dnsmasq is not using the new components so you will not get access to it via the API but if you build your own plugin, you can design the API as you like.
« Last Edit: August 22, 2018, 06:49:58 pm by fabian »
Logged

Lord_Pinhead

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Adding Rule after plugin installation
« Reply #2 on: August 23, 2018, 08:03:38 am »
I start with the helloworld example and check_mk. But still i need to open a Port on an Interface after the plugin was installed.
Adding the inetd entry is a new Action, that should not be a Problem.

vlmcsd is not a Problem for me, the Firewall is running in my own Office Environment and is for deploying a MS Lab Setup. MS even has a list of VL Keys in the MSDN for that reason.


Logged

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: Adding Rule after plugin installation
« Reply #3 on: August 23, 2018, 05:12:07 pm »
This will not work after the installation but after a firewall reload: https://github.com/opnsense/plugins/blob/master/net/frr/src/etc/inc/plugins.inc.d/frr.inc#L39

You may trigger a reload after the installation.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • Adding Rule after plugin installation
 

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