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

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

firewalling a bit better

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