]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/examples/ipfilter/firewall.1
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / examples / ipfilter / firewall.1
1 # $FreeBSD$
2 #
3 #  This is an example of a very light firewall used to guard against
4 #  some of the most easily exploited common security holes.
5 #
6 #  The example assumes it is running on a gateway with interface ppp0
7 #  attached to the outside world, and interface ed0 attached to
8 #  network 192.168.4.0 which needs to be protected.
9 #
10 #
11 #  Pass any packets not explicitly mentioned by subsequent rules
12 #
13 pass out from any to any
14 pass in from any to any
15 #
16 #  Block any inherently bad packets coming in from the outside world.
17 #  These include ICMP redirect packets and IP fragments so short the
18 #  filtering rules won't be able to examine the whole UDP/TCP header.
19 #
20 block in log quick on ppp0 proto icmp from any to any icmp-type redir
21 block in log quick on ppp0 proto tcp/udp all with short
22 #
23 #  Block any IP spoofing attempts.  (Packets "from" our network
24 #  shouldn't be coming in from outside).
25 #
26 block in log quick on ppp0 from 192.168.4.0/24 to any
27 block in log quick on ppp0 from localhost to any
28 block in log quick on ppp0 from 0.0.0.0/32 to any
29 block in log quick on ppp0 from 255.255.255.255/32 to any
30 #
31 #  Block any incoming traffic to NFS ports, to the RPC portmapper, and
32 #  to X servers.
33 #
34 block in log on ppp0 proto tcp/udp from any to any port = sunrpc
35 block in log on ppp0 proto tcp/udp from any to any port = 2049
36 block in log on ppp0 proto tcp from any to any port = 6000