Changeset 10206 in hybrid for branches/releng-9.0/nanobsd/files


Ignore:
Timestamp:
Mar 17, 2012, 5:45:39 PM (13 years ago)
Author:
richardvm
Message:

firewalling a bit better

Location:
branches/releng-9.0/nanobsd/files/etc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-9.0/nanobsd/files/etc/ipfw.sh

    r10201 r10206  
    6666for INF in $captive_portal_interfaces; do
    6767  ${fwcmd} add 10100 fwd 172.31.255.1,8081 tcp from any to not 172.16.0.0/12 80 in via ${INF}
    68   ${fwcmd} add 11000 deny ip from any to any in via ${INF}
     68  ${fwcmd} add 11000 deny ip from any to not 172.16.0.0/12 443 in via ${INF}
    6969done
  • branches/releng-9.0/nanobsd/files/etc/pf.conf.ileiden

    r10200 r10206  
    22int_if="tap0"
    33wifi_if="wlan0"
     4all_node="172.31.255.1/32"
    45
    56wl_net="172.16.0.0/12"
    67vpn_net="172.17.64.0/28"
    78
    8 publicnat="{80, 443}"
     9publicnat="{80, 443, 22}"
    910allow_ext_tcp="{22}"
    1011allow_ext_udp="{161}"
    11 allow_int_tcp="{22,53,80,3128,12345}"
    12 allow_int_udp="{53,67,68,131,161,12345}"
     12allow_int_tcp="{22,53,80,3128}"
     13allow_int_udp="{53,131,161,12345}"
     14allow_int_udp_any="{67}"
    1315
    1416private="{ 10.0.0.0/8 , 192.168.0.0/16 }"
     
    1820
    1921# Nat local wl access
    20 nat on $int_if from any to $wl_net -> ($int_if)
    21 pass on $ext_if from any to $wl_net keep state
     22nat on $int_if from $private to $wl_net -> ($int_if)
    2223
    2324# Block all
     
    2526pass in on $int_if
    2627
     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
    2760# Make sure to block local network access from wl
    2861block on $wifi_if from $wl_net to $private
    2962block on $int_if from $wl_net to $private
    3063
    31 # Allow wl access from access point (not yet reversed)
    32 pass on $wifi_if from $wl_net to $wl_net
    33 
    34 # Allow directives
    35 pass in on $ext_if inet proto tcp from any to $ext_if port $allow_ext_tcp keep state
    36 pass in on $ext_if inet proto udp from any to $ext_if port $allow_ext_udp keep state
    37 pass in on $int_if inet proto tcp from any to $vpn_net port $allow_int_tcp keep state
    38 pass in on $int_if inet proto udp from any to $vpn_net port $allow_int_udp keep state
    39 pass in on $int_if inet proto icmp from $wl_net to $vpn_net keep state
    40 
    41 # Enable statefull firewalling
    42 pass out on {$ext_if, $int_if} keep state
    43 
    44 
    45 
  • branches/releng-9.0/nanobsd/files/etc/rc.conf

    r10205 r10206  
    5858pf_enable="YES"
    5959pf_rules="/etc/pf.conf.ileiden"
    60 pf_flags=""
    6160pf2_enable="YES"
Note: See TracChangeset for help on using the changeset viewer.