source: hybrid/branches/releng-9.0/nanobsd/files/etc/pf.conf.ileiden@ 10200

Last change on this file since 10200 was 10200, checked in by richardvm, 13 years ago

Blocking local access (natting prefent current setup

File size: 1.3 KB
Line 
1ext_if="sis0"
2int_if="tap0"
3wifi_if="wlan0"
4
5wl_net="172.16.0.0/12"
6vpn_net="172.17.64.0/28"
7
8publicnat="{80, 443}"
9allow_ext_tcp="{22}"
10allow_ext_udp="{161}"
11allow_int_tcp="{22,53,80,3128,12345}"
12allow_int_udp="{53,67,68,131,161,12345}"
13
14private="{ 10.0.0.0/8 , 192.168.0.0/16 }"
15
16# Nat the internet
17nat on $ext_if from $wl_net to any port $publicnat -> ($ext_if)
18
19# Nat local wl access
20nat on $int_if from any to $wl_net -> ($int_if)
21pass on $ext_if from any to $wl_net keep state
22
23# Block all
24block in on $ext_if
25pass in on $int_if
26
27# Make sure to block local network access from wl
28block on $wifi_if from $wl_net to $private
29block on $int_if from $wl_net to $private
30
31# Allow wl access from access point (not yet reversed)
32pass on $wifi_if from $wl_net to $wl_net
33
34# Allow directives
35pass in on $ext_if inet proto tcp from any to $ext_if port $allow_ext_tcp keep state
36pass in on $ext_if inet proto udp from any to $ext_if port $allow_ext_udp keep state
37pass in on $int_if inet proto tcp from any to $vpn_net port $allow_int_tcp keep state
38pass in on $int_if inet proto udp from any to $vpn_net port $allow_int_udp keep state
39pass in on $int_if inet proto icmp from $wl_net to $vpn_net keep state
40
41# Enable statefull firewalling
42pass out on {$ext_if, $int_if} keep state
43
44
45
Note: See TracBrowser for help on using the repository browser.