Hey there,
I have 2 extra pf.conf.primary and pf.conf.fallback files which include
pf.conf as an anchor and are loaded by ifstated depending on the status
of pppoe2. I have the following two lines in the "shared" pf.conf:
match out on pppoe2 inet nat-to pppoe2
match out on cnmac1 inet nat-to cnmac1
If pppoe2 is down, there's no problem and the line is ignored. If cnmac1
is down however, pf refuses to load the ruleset because it can't resolve
the network address (dhcp). I always need *that* nat rule because vlan3
needs it to establish an ipsec tunnel to a remote forwarder, to be used
in case the primary link goes down.
The bigger beef is that the fallback LTE router is untrusted (the entire
link is on rdomain 1) and can currently produce a DoS by turning its
interface off:
/etc/pf.conf:32: could not parse host specification
pfctl: Syntax error in config file: pf rules not loaded
Is there a way to get pf to treat cnmac1 nat-ing the way it does pppoe2,
or do I have to maintain four different states in ifstated?
---
topology:
ap
|
[cnmac0]
|
ap - [cnmac0] - switch - [cnmac0] - ap
|
[cnmac0, vlan0]
|
fallback - [cnmac1] - OpenBSD - [cnmac2] - [pppoe2] - primary
|
[cnmac3, vlan3]
|
dmz
---
packet flow:
vlan3 nats to cnmac1 (maintains an ipsec link via the fallback)
cnmac3, cnmac0, vlan0 nats to active link [primary or fallback]
cnmac2 redirects ports to cnmac3
port forwarding for fallback link is done via the ipsec tunnel
vlan0 is a private network that is not accessible via wifi or
unconfigured wire (yeah, two bytes of security isn't much, but this
is a domestic setup so it's mostly about preventing access by
default)