Changeset 10610 in hybrid for branches/releng-9.0/nanobsd/files/etc/pf.proxy.conf
- Timestamp:
- Apr 29, 2012, 1:51:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-9.0/nanobsd/files/etc/pf.proxy.conf
r10589 r10610 18 18 # Rick van der Zwet <rick@wirelessleiden.nl> 19 19 # 20 wl_net="172.16.0.0/12"21 ileiden_ports="80,443"22 allow_ext_tcp="{ssh, domain}"23 allow_ext_udp="{domain, snmp}"24 private="{ 10.0.0.0/8, 172.16.0.0/12 192.168.0.0/16 }"25 20 21 # Standard port allow listings 22 allow_ext_in_tcp="ssh, domain" 23 allow_ext_in_udp="domain, snmp" 24 25 allow_ext_out_tcp = "domain, http, https, 1194" 26 allow_ext_out_udp = "domain, ntp, 1194" 26 27 27 28 # Default configuration for ALIX2 with vr0 as external interface and wlan0 as … … 31 32 ext_if_gw="127.127.127.127" 32 33 captive_portal_interfaces="wlan0" 33 publicnat="http,https"34 #publicnat="http,https" 34 35 masterip="127.0.0.1" 35 36 # For an traditional proxy setup set, uncomment: 36 #publicnat=0 37 publicnat=0 38 39 # Global standards. NOT to be edited. 40 wl_net="172.16.0.0/12" 41 private="{ 10.0.0.0/8, 172.16.0.0/12 192.168.0.0/16 }" 42 ileiden_ports="http,https" 43 37 44 38 45 # Always be nice, and return the fact we are blocking the packets … … 49 56 50 57 # Nat the internet for iLeiden functionality (1) 51 nat on $ext_if inet proto tcp from $wl_net to any port { $ ileiden_ports} -> ($ext_if)58 nat on $ext_if inet proto tcp from $wl_net to any port { $publicnat } -> ($ext_if) 52 59 53 60 # Nat to the internet for packets which are orginating from itself for proxy functionality (8) 54 nat on !$ext_if inet proto tcp from $wl_net to any port { $ileiden_ports } -> ($ext_if) 61 nat on !$ext_if inet proto tcp from $wl_net to any port { $allow_ext_out_tcp } -> ($ext_if) 62 nat on !$ext_if inet proto udp from $wl_net to any port { $allow_ext_out_udp } -> ($ext_if) 55 63 56 64 # Redirect some internal facing services outside, please mind also need allow rules (bottom of file) (7) 57 rdr on $ext_if inet proto tcp from any to $ext_if port 8081 -> 172.16.4.46 port 8065 rdr on $ext_if inet proto tcp from any to $ext_if port 8081 -> 172.16.4.46 port http 58 66 59 67 # Redirect user to captive portal they have not clicked OK yet (6) 60 no rdr on { $captive_portal_interfaces } proto tcp from <wlportal> to !$wl_net port 8061 rdr on { $captive_portal_interfaces } proto tcp from $wl_net to !$wl_net port 80-> 172.31.255.1 port 808168 no rdr on { $captive_portal_interfaces } proto tcp from <wlportal> to !$wl_net port http 69 rdr on { $captive_portal_interfaces } proto tcp from $wl_net to !$wl_net port http -> 172.31.255.1 port 8081 62 70 63 71 # Localhost is considered safe (5) … … 68 76 69 77 # This quirck is needed to override the routing table default route (8) 70 pass out on !$ext_if route-to ($ext_if $ext_if_gw) proto tcp from any to !$wl_net port { 22, 80, 443} user != unknown keep state71 pass out on !$ext_if route-to ($ext_if $ext_if_gw) proto udp from any to !$wl_net port { 53} user != unknown keep state78 pass out on !$ext_if route-to ($ext_if $ext_if_gw) proto tcp from any to !$wl_net port { $allow_ext_out_tcp } user != unknown keep state 79 pass out on !$ext_if route-to ($ext_if $ext_if_gw) proto udp from any to !$wl_net port { $allow_ext_out_udp } user != unknown keep state 72 80 73 81 # By default deny all outgoing traffic to avoid systems spamming the network (9) … … 81 89 82 90 # Expose some local services (4) 83 pass in on $ext_if inet proto tcp from any to $ext_if port $allow_ext_tcpkeep state84 pass in on $ext_if inet proto udp from any to $ext_if port $allow_ext_udpkeep state91 pass in on $ext_if inet proto tcp from any to $ext_if port { $allow_ext_in_tcp } keep state 92 pass in on $ext_if inet proto udp from any to $ext_if port { $allow_ext_in_udp } keep state 85 93 pass in on $ext_if inet proto icmp from any to $ext_if icmp-type { echoreq } 86 94 … … 88 96 pass in on $ext_if from $private to $wl_net keep state 89 97 90 # Allow exposing some WL Services to the inet(7)98 # Allow exposing some (internal) WL Services to the inet - see rdr on top as well (7) 91 99 pass in on $ext_if inet proto tcp from any to $ext_if port { 8081 } keep state 92 100 … … 96 104 97 105 # For proper functioning allow the local machine to initiate requests outside (4) 98 pass out on $ext_if inet proto udp from $ext_if to any port{domain, 1194} keep state99 pass out on $ext_if inet proto tcp from $ext_if to any port{http, https, 1194} keep state106 pass out on $ext_if inet proto tcp from $ext_if to any port { $allow_ext_out_tcp } keep state 107 pass out on $ext_if inet proto udp from $ext_if to any port { $allow_ext_out_udp } keep state 100 108 pass out on $ext_if inet proto icmp from $ext_if to any icmp-type { echoreq } 101 109
Note:
See TracChangeset
for help on using the changeset viewer.