Hi, iI'm trying to serve a website for a friend on my VPS which uses jails for each service iI need.
I configured this new jail for friends website but seemsiI fail to properly configure PF to redirect traffic on second public IP iI have to new jail.
This is my pf.conf:
Traffic to www1 works properly but www2 isn't for some reason.
Can anyone push me in right direction or offer potential solution?
Thanks in advance!
I configured this new jail for friends website but seems
This is my pf.conf:
Code:
# Macros
nic = "vtnet0"
ip1 = "111.111.111.111"
ip2 = "222.222.222.222"
lan = "192.168.1.1/24"
www1 = "192.168.1.2"
www2 = "192.168.1.5"
# Options
set skip on lo
set block-policy drop
set loginterface $nic
# Normalization
scrub in no-df random-id
# NAT
nat pass on $nic from $lan -> $ip1
rdr on $nic inet proto tcp to port {80,443,30000,44000} -> $www1
nat pass on $nic from $www2 -> $ip2
rdr on $nic inet proto tcp to $ip2 port {80,443} -> $www2
# Filtering
block in log
antispoof quick for $nic inet
pass in proto tcp to port {25,80,443}
pass out
Traffic to www1 works properly but www2 isn't for some reason.
Can anyone push me in right direction or offer potential solution?
Thanks in advance!