Currently I am using OpenVPN to redirect all my traffic and it works great! However, there are a few servers on the network and they require access to some ports on the WAN. Here is my current pf.conf, I am going to remove most of the rdr rules and just keep it simple.
This network is behind another router that is forwarding ports 80 and 443 to $egress_ip. pftop is showing that the reply-to rule is not being used at all when bringing up to the website.
I also have fibs=2 so using rtable 1 will work, however making a rule to use it does not seem to work well, or I'm not doing it properly.
Any help would be most appreciated!
Code:
# Variables and Macro
lan="igb1"
egress="igb0"
lan_ip="192.168.1.1"
egress_ip="192.168.0.2"
gateway="192.168.0.1"
webserver="192.168.1.8
vpn="tun0"
# Global Policy
set block-policy drop
set loginterface $egress
set skip on lo
scrub all no-df max-mss 1440 random-id reassemble tcp
scrub out on $egress proto udp from $egress_ip to any port 443 set-tos lowdelay
# NAT and RDR rules :
# 1 - only NAT trough the VPN connection. If the VPN is down, there is no Internet access for the LAN.
# 2 - catch DNS leaks from the LAN to the Internet and redirect them to our router
nat on $vpn from ($lan:network) to any -> ($vpn:0)
nat on $egress from ($lan:network) to any -> ($egress)
rdr on $lan proto { tcp udp } from $lan:network to ! $lan_ip port 53 -> $lan_ip
# Services
rdr pass on $egress inet proto tcp from any to ($egress) port 80 tag webserver -> $webserver port 443
rdr pass on $egress inet proto tcp from any to ($egress) port 443 tag webserver -> $webserver port 443
# Default deny and log all
block log all
# Antispoof
antispoof log quick for ($egress)
antispoof quick for ($lan)
block in quick log on $egress from { no-route urpf-failed } to any
block out quick log on $egress from any to no-route
# Block IPV6
block quick inet6 all
# Prevent VPN bypass
block out quick log on $egress from ($lan:network) to any
# Drop outbound DNS requests (53), as we use DNSCrypt
block out quick log on $egress proto { tcp udp } from any to any port 53
# Standard rules
pass out quick inet modulate state
pass in quick on $egress reply-to ( $egress $egress_ip ) tagged webserver keep state
pass in on $lan
This network is behind another router that is forwarding ports 80 and 443 to $egress_ip. pftop is showing that the reply-to rule is not being used at all when bringing up to the website.
I also have fibs=2 so using rtable 1 will work, however making a rule to use it does not seem to work well, or I'm not doing it properly.
Any help would be most appreciated!