OSDN Git Service

Ver.1.4.37: Fix error in radius authentication
[opengate/opengate.git] / opengate / conf / rc.firewall.sample
1 ### set these to your outside interface network and netmask and ip
2 oif="fxp1"
3 onet="192.168.0.0"
4 omask="255.255.255.0"
5 oip="192.168.0.124"
6 onet6="fe80::"
7 oprefixlen6="64"
8 oip6="fe80::202:b3ff:fe0a:c30e"
9
10 ### set these to your inside interface network and netmask and ip
11 iif="fxp0"
12 inet="192.168.1.0"
13 imask="255.255.255.0"
14 iip="192.168.1.1"
15 inet6="2001:2f8:22:802::"
16 iprefixlen6="64"
17 iip6="2001:2f8:22:802::1"
18
19 fwcmd="/sbin/ipfw"
20
21 ### reset firewall rules
22 $fwcmd -q -f flush
23
24 ### divert packet to NATD 
25 $fwcmd add 1 divert natd ip4 from any to any via ${oif}
26
27 ### Stop spoofing
28 $fwcmd add deny all from ${inet}:${imask} to any in via ${oif}
29 $fwcmd add deny all from ${onet}:${omask} to any in via ${iif}
30
31 ### Allow from / to myself
32 $fwcmd add pass all from ${iip} to any via ${iif}
33 $fwcmd add pass all from ${oip} to any via ${oif}
34 $fwcmd add pass all from any to ${iip} via ${iif}
35 $fwcmd add pass all from any to ${oip} via ${oif}
36 $fwcmd add pass all from ${iip6} to any via ${iif}
37 $fwcmd add pass all from ${oip6} to any via ${oif}
38 $fwcmd add pass all from any to ${iip6} via ${iif}
39 $fwcmd add pass all from any to ${oip6} via ${oif}
40
41 ### Allow DNS queries out in the world
42 ### (if DNS is on localhost, delete passDNS)
43 $fwcmd add pass udp from any 53 to any
44 $fwcmd add pass udp from any to any 53
45 $fwcmd add pass tcp from any to any 53
46 $fwcmd add pass tcp from any 53 to any
47
48 ### Allow RA RS NS NA Redirect...
49 $fwcmd add pass ipv6-icmp from any to any
50
51 # Allow IP fragments to pass through
52 $fwcmd add pass all from any to any frag
53
54 # Allow RIPng
55 $fwcmd add pass udp from fe80::/10 521 to ff02::9 521
56 $fwcmd add pass udp from fe80::/10 521 to fe80::/10 521
57
58 ### Forwarding IPv4 http connection from unauth client 
59 $fwcmd add 60000 fwd localhost tcp from ${inet}:${imask} to any 80
60 $fwcmd add 60000 fwd localhost tcp from ${inet}:${imask} to any 443
61
62 ### Allow http reply for forwarded request 
63 ### (it is sent out from localhost but has original source address)
64 $fwcmd add 60100 pass tcp from any 80 to any out
65 $fwcmd add 60100 pass tcp from any 443 to any out
66
67 # TCP reset notice message for IPv6 http connection
68 $fwcmd add 60200 reset tcp from any to any 80
69 $fwcmd add 60300 reset tcp from any to any 443
70
71