aboutsummaryrefslogtreecommitdiffstats
path: root/templates/ingress/etc_pf.conf.j2
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-10-22 22:45:15 +0300
committerJan Tuomi <jan@jantuomi.fi>2025-10-22 22:45:15 +0300
commit5263aa814da9852294ea64c77af22a1cd2507fca (patch)
tree4bfec8e587cb34b803cb14f6d32fa3ee7381a118 /templates/ingress/etc_pf.conf.j2
parentfea0aff43b6c7cc14ba848f97afb17999ff65c17 (diff)
Improvements
Diffstat (limited to 'templates/ingress/etc_pf.conf.j2')
-rw-r--r--templates/ingress/etc_pf.conf.j219
1 files changed, 19 insertions, 0 deletions
diff --git a/templates/ingress/etc_pf.conf.j2 b/templates/ingress/etc_pf.conf.j2
new file mode 100644
index 0000000..c8045fd
--- /dev/null
+++ b/templates/ingress/etc_pf.conf.j2
@@ -0,0 +1,19 @@
+{% for jail in jails -%}
+{% if jail.name == 'ingress' -%}
+# Interfaces & nets
+lan = "epl{{ jail.num }}b"
+wan = "epw{{ jail.num }}b"
+lan_net = "{{ lan_ipv4_cidr }}"
+
+# Keep PF out of loopback, drop by default if you add blocks later
+set skip on lo0
+set block-policy drop
+
+# NAT: translate LAN traffic to the WAN interface address, and log it
+nat log on $wan from $lan_net to any -> ($wan)
+
+# Allow and log the LAN traffic so NAT can happen
+pass in on $lan inet from $lan_net to any keep state
+pass out on $wan inet from $lan_net to any keep state
+{% endif %}
+{% endfor %}