[10242] | 1 | all_node="172.31.255.1/32"
|
---|
| 2 | wl_net="172.16.0.0/12"
|
---|
| 3 | allow_ext_tcp="{22}"
|
---|
| 4 | allow_ext_udp="{161}"
|
---|
[10417] | 5 | allow_int_tcp="{22,3128}"
|
---|
| 6 | allow_int_udp="{53,161,12345}"
|
---|
[10242] | 7 | allow_int_udp_any="{67}"
|
---|
| 8 |
|
---|
| 9 | private="{ 10.0.0.0/8 , 192.168.0.0/16 }"
|
---|
| 10 |
|
---|
| 11 | # Nat the internet
|
---|
| 12 | nat on $ext_if from $wl_net to any port $publicnat -> ($ext_if)
|
---|
| 13 |
|
---|
| 14 | # Nat local wl access
|
---|
| 15 | nat on $int_if from $private to $wl_net -> ($int_if)
|
---|
| 16 |
|
---|
[10417] | 17 | # Redirection, needs source natting and allow rules
|
---|
| 18 | #rdr on $ext_if inet proto tcp from any to $ext_if port 1022 -> 192.168.84.1 port 22
|
---|
| 19 |
|
---|
[10418] | 20 | # Localhost is considered safe
|
---|
| 21 | pass quick on lo0 all
|
---|
| 22 |
|
---|
[10242] | 23 | # Block all
|
---|
[10417] | 24 | block in on $ext_if from any to $ext_if
|
---|
| 25 | block in on $int_if from any to $int_if
|
---|
[10242] | 26 |
|
---|
[10417] | 27 | # Allow private to private
|
---|
[10242] | 28 | # Enable me to access anything
|
---|
[10417] | 29 | pass out on {$ext_if, $int_if} keep state
|
---|
[10242] | 30 |
|
---|
| 31 | # Allow internet access from the network
|
---|
[10417] | 32 | pass in on $int_if inet proto tcp from $wl_net to any port $publicnat keep state
|
---|
| 33 | block in on $int_if inet proto tcp from $wl_net to $int_if port $publicnat
|
---|
[10242] | 34 |
|
---|
| 35 | # Allow directives
|
---|
| 36 | pass in on $ext_if inet proto tcp from any to $ext_if port $allow_ext_tcp keep state
|
---|
| 37 | pass in on $ext_if inet proto udp from any to $ext_if port $allow_ext_udp keep state
|
---|
| 38 |
|
---|
[10417] | 39 | pass in on $int_if inet proto tcp from $wl_net to $int_if port $allow_int_tcp keep state
|
---|
| 40 | pass in on $int_if inet proto udp from $wl_net to $int_if port $allow_int_udp keep state
|
---|
| 41 | pass in on $int_if inet proto icmp from $wl_net to $int_if keep state
|
---|
[10242] | 42 |
|
---|
| 43 | # Allow wl access from local network
|
---|
| 44 | pass on $ext_if from $private to $wl_net keep state
|
---|
| 45 |
|
---|
| 46 | # Make sure to block local network access from wl
|
---|
| 47 | block on $int_if from $wl_net to $private
|
---|
| 48 |
|
---|
[10417] | 49 | # Otherwise lvrouted breaks:
|
---|
| 50 | pass in on $int_if
|
---|