Is it possible to have NAT but to use local DNS server (unbound) on one host?
I have a FreeBSD router which is connected to Internet. Clients connects to that router via another WLAN interface. That works fine.
Buy I am trying to use unbound daemon run on that router to do some basic filtering. That works fine but only from that router. WLAN clients can't use that DNS server.
Best I can do is to redirect DNS to another external DNS in pf.conf:
If I try to redirect it to 127.0.0.1 or 192.168.11.1 (address of the router, unbound listen on that address and on 127.0.0.1) and issue "ping www.opendns.org":
Is that possible with pf?
forums.freebsd.org
Can I use alias on the interface and then redirect? Something else?
I have a FreeBSD router which is connected to Internet. Clients connects to that router via another WLAN interface. That works fine.
Buy I am trying to use unbound daemon run on that router to do some basic filtering. That works fine but only from that router. WLAN clients can't use that DNS server.
Best I can do is to redirect DNS to another external DNS in pf.conf:
Code:
rdr log on $int_if inet proto {tcp, udp} from any to any port domain -> 1.1.1.1
If I try to redirect it to 127.0.0.1 or 192.168.11.1 (address of the router, unbound listen on that address and on 127.0.0.1) and issue "ping www.opendns.org":
Code:
pf.conf:
rdr pass log on $int_if proto {tcp, udp} from any to any port domain -> 127.0.0.1
rdr pass log on $int_if proto {tcp, udp} from any to any port domain -> 192.168.11.1
pflog:
00:00:12.880126 rule 1/0(match): rdr in on wlan0: 192.168.11.2.64436 > 127.0.0.1.53: 47724+ A? www.opendns.org. (33)
unbound.log:
- nothing
Is that possible with pf?
Redirections cannot reflect packets back through the interface they
arrive on, they can only be redirected to hosts connected to different
interfaces or to the firewall itself.

PF - Redirect all local outbound traffic
I've been searching high and low for days and I'm 100% stuck with PF. Essentially I want to take all of my local, outbound HTTP(S) traffic and redirect it to a local proxy on 127.0.0.1:7777. I've tried every rdr, rdr-to, nat-to, nat on combo I came across and none of them seem to work. Could...
PF can not redirect traffic that originates from the host itself because the routing decision for the traffic has been already made by the time it gets to the filter. It's a FreeBSD specific limitation that does not exist on OpenBSD's PF for example.
Can I use alias on the interface and then redirect? Something else?