OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 20.7 Legacy Series »
  • Loading pftables from files
« previous next »
  • Print
Pages: [1]

Author Topic: Loading pftables from files  (Read 1940 times)

clopmz

  • Newbie
  • *
  • Posts: 21
  • Karma: 1
    • View Profile
Loading pftables from files
« on: August 07, 2020, 03:50:51 pm »
Hi all,

 I have configured several pftables as external sources and I have scheduled several cronjobs to create/update these pftables and to store data in plain files. But how can I configure opnsense to read these files and insert data in the correct pftable every time fw start or restarts?

Thanks
Logged

clopmz

  • Newbie
  • *
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Loading pftables from files
« Reply #1 on: August 10, 2020, 12:18:13 pm »
Please, any help/tip on this?
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17751
  • Karma: 1620
    • View Profile
Re: Loading pftables from files
« Reply #2 on: August 10, 2020, 12:29:13 pm »
Hi there,

https://docs.opnsense.org/manual/aliases.html

"External (advanced)

Externally managed alias, this only handles the placeholder. Content is set from another source (plugin, api call, etc)"

https://docs.opnsense.org/manual/aliases.html#add-new-entries-using-our-api


Cheers,
Franco
Logged

clopmz

  • Newbie
  • *
  • Posts: 21
  • Karma: 1
    • View Profile
Re: Loading pftables from files
« Reply #3 on: August 10, 2020, 01:12:29 pm »
Thanks Franco,

 Is it the only option? I would like my pf tables be consistent when fw starts ... Using curl option, pf tables will be empty until scripts run ...
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17751
  • Karma: 1620
    • View Profile
Re: Loading pftables from files
« Reply #4 on: August 10, 2020, 01:29:05 pm »
pfctl can help you:

https://www.openbsdhandbook.com/pf/cheat_sheet/#maintaining-pf-tables

Syntax may differ a little from OpenBSD to FreeBSD.

You can run system "start" hooks via:

https://docs.opnsense.org/development/backend/autorun.html


Cheers,
Franco
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 20.7 Legacy Series »
  • Loading pftables from files
 

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