Hi,
I have a problem with my PF it seems after all verification made with
So first I tried:
...then:
...and then:
...without a single error so I will paste my pf.conf for more detailed info:
Can anyone help me with my configuration? To make PF start at FreeBSD startup?
In this actual state of PF configuration at reboot of server it doesn't load at startup and my site doesn't start obviously, because of NAT that PF it make.
Any help is welcome.
I have a problem with my PF it seems after all verification made with
pfctl -vnf /etc/pf.conf
NOT with the rulesets but number of tables and the size of it. Can be adjusted this situation? I can't control the size of tables for zones because are country based IP net blocks.So first I tried:
Code:
#pfctl -nf /etc/pf.conf
#
Code:
#pfctl -vnf /etc/pf.conf
#
Code:
# pfctl -sa /etc/pf.conf
nat on igb1 inet from 192.x.x.0/27 to ! (igb1) -> (igb1) round-robin
rdr on tun0 inet proto tcp from 172.x.x.x to (tun0) port = ssh -> 127.0.0.1 port 65535
rdr on tun0 inet proto tcp from any to (tun0) port = http -> 192.x.x.x
rdr on tun0 inet proto tcp from any to (tun0) port = https -> 192.x.x.x
rdr on igb1 inet proto tcp from any to (igb1) port = http -> 192.x.x.x
rdr on igb1 inet proto tcp from any to (igb1) port = https -> 192.x.x.x
rdr on igb1 inet proto tcp from any to (igb1) port = ssh -> 192.x.x.x
FILTER RULES:
scrub in all fragment reassemble
block drop in all
... (to much to write down, pf.conf is displayed in next code block) ...
State Table Total Rate
[LEFT] current entries 10
searches 220516 0.2/s
inserts 5752 0.0/s
removals 5742 0.0/s
Counters
match 18891 0.0/s
bad-offset 0 0.0/s
fragment 0 0.0/s
short 0 0.0/s
normalize 0 0.0/s
memory 0 0.0/s
bad-timestamp 0 0.0/s
congestion 0 0.0/s
ip-option 0 0.0/s
proto-cksum 0 0.0/s
state-mismatch 1 0.0/s
state-insert 0 0.0/s
state-limit 0 0.0/s
src-limit 0 0.0/s
synproxy 0 0.0/s[/LEFT]
TIMEOUTS:
tcp.first 5s
tcp.opening 5s
tcp.established 1800s
tcp.closing 5s
tcp.finwait 5s
tcp.closed 5s
tcp.tsdiff 10s
udp.first 10s
udp.single 30s
udp.multiple 30s
icmp.first 20s
icmp.error 10s
other.first 10s
other.single 20s
other.multiple 20s
frag 4s
interval 10s
adaptive.start 1500 states
adaptive.end 5000 states
src.track 0s
LIMITS:
states hard limit 10000
src-nodes hard limit 10000
frags hard limit 5000
table-entries hard limit 200000
TABLES:
blockedips
block_zone-br_1
block_zone-br_2
block_zone-cn_1
block_zone-cn_2
block_zone-ru_1
block_zone-ru_2
block_zone-tw_1
block_zone-tw_2
block_zone-us_1
block_zone-us_2
others2_block_zone
permit_ggle-bot
OS FINGERPRINTS:
710 fingerprints loaded
...without a single error so I will paste my pf.conf for more detailed info:
Code:
###Interfaces
localhost="127.0.0.1"
openvpn="1194"
nginx="192.X.X.X"
adm="192.X.X.X"
permit_vpn_ssh="172.X.X.X"
permit_ssh="{172.X.X.X, 85.X.X.X, X.X.X.X}"
permit_web="{86.X.X.X, 85.X.X.X, X.X.X.X}"
permit_ftp="{85.X.X.X, 86.X.X.X, X.X.X.X}"
###Tables
table <blockedips> persist file "/etc/pf/../../pf.blockedips.conf"
table <permit_ggle-bot> persist file "/etc/pf/../../pf.permit_ggl-bot.conf"
table <block_zone-cn_1> persist file "/etc/pf/../../IPDeny_CountryZones/cn.zone"
table <block_zone-cn_2> persist file "/etc/pf/../../IPDeny_CountryZones/cn-aggregated.zone"
table <block_zone-ru_1> persist file "/etc/pf/../../IPDeny_CountryZones/ru.zone"
table <block_zone-ru_2> persist file "/etc/pf/../../IPDeny_CountryZones/ru-aggregated.zone"
table <block_zone-us_1> persist file "/etc/pf/../../IPDeny_CountryZones/us.zone"
table <block_zone-us_2> persist file "/etc/pf/../../IPDeny_CountryZones/us-aggregated.zone"
table <block_zone-br_1> persist file "/etc/pf/../../IPDeny_CountryZones/br.zone"
table <block_zone-br_2> persist file "/etc/pf/../../IPDeny_CountryZones/br-aggregated.zone"
table <block_zone-tw_1> persist file "/etc/pf/../../IPDeny_CountryZones/tw.zone"
table <block_zone-tw_2> persist file "/etc/pf/../../IPDeny_CountryZones/tw-aggregated.zone"
table <others2_block_zone> persist file "/etc/pf/../../IPDeny_CountryZones/other/other2-ip-block.zone"
###no filter
set skip on lo0
set skip on lo1
###Options
set block-policy drop
set loginterface igb1
###Optimizations
set optimization aggressive
set timeout { frag 4, tcp.established 1800 }
set timeout { tcp.first 5, tcp.closing 5, tcp.closed 5, tcp.finwait 5 }
set timeout { udp.first 10, udp.single 30, udp.multiple 30 }
set timeout { other.first 10, other.single 20, other.multiple 20 }
set timeout { adaptive.start 1500, adaptive.end 5000 }
###Normalization
scrub in all
###NAT
nat on igb1 from 192.x.x.0/27 to !(igb1) -> (igb1)
###Redir
rdr on tun0 inet proto tcp from $permit_vpn_ssh to (tun0) port 22 -> $localhost port 65535
rdr on tun0 inet proto tcp from any to (tun0) port {80, 443} -> $nginx
rdr on igb1 inet proto tcp from any to (igb1) port {80, 443} -> $nginx
rdr on igb1 inet proto tcp from any to (igb1) port 22 -> $adm
###Base ruleset
block in all
###antispoof for all interfaces
block in quick from urpf-failed
antispoof for igb1 inet
antispoof log for $localhost
###Policy of blocking
block in log quick on igb1 from <blockedips> to any
###Blocking OTHERS
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <others1_block_zone> to any
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <others2_block_zone> to any
###Blocking CN
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-cn_1> to any
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-cn_2> to any
###Blocking RU
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-ru_1> to any
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-ru_2> to any
###Blocking US
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-us_1> to any
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-us_2> to any
###Blocking BR
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-br_1> to any
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-br_2> to any
###Blocking TW
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-tw_1> to any
block in log quick on igb1 proto {tcp, udp, icmp, ipv6, icmp6} from <block_zone-tw_2> to any
###Accept
pass in log quick on igb1 proto tcp from <permit_ggle-bot> to $nginx port {80, 443} flags S/SA keep state
pass in quick on tun0 inet proto tcp from $permit_vpn_ssh to $localhost port 65535 keep state
pass in quick on igb1 inet proto tcp from any to $adm port 22 flags S/SA keep state
pass in quick on igb1 inet proto tcp from $permit_ssh to (igb1) port 65535 flags S/SA keep state
pass in quick on igb1 inet proto tcp from any to $nginx port {80, 443} flags S/SA keep state
pass in quick on tun0 inet proto tcp from any to $nginx port {80, 443} flags S/SA keep state
pass in quick on igb1 inet proto udp from any to (igb1) port $openvpn
pass out on igb1 all
Can anyone help me with my configuration? To make PF start at FreeBSD startup?
In this actual state of PF configuration at reboot of server it doesn't load at startup and my site doesn't start obviously, because of NAT that PF it make.
Any help is welcome.