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

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

sync pf setup of hybrid with that of the proxies.

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