Loading pftables from files

Started by clopmz, August 07, 2020, 03:50:51 PM

Previous topic - Next topic
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


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

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 ...

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