simplified result array in filter_domains()
[ferm.git] / examples / fileserver.ferm
blob9bea5398da5422d6253bd2502fba179544a25190
1 # -*- shell-script -*-
3 # Ferm example script
5 # Firewall configuration for a file server (NFSv4 and SMB).
7 # Author: Max Kellermann <max@duempel.org>
10 table filter {
11     chain INPUT {
12         policy DROP;
14         # connection tracking
15         mod state state INVALID DROP;
16         mod state state (ESTABLISHED RELATED) ACCEPT;
18         # allow local connections
19         interface lo ACCEPT;
21         # respond to ping
22         proto icmp icmp-type echo-request ACCEPT;
24         # remote administration
25         proto tcp dport ssh ACCEPT;
27         # samba
28         proto tcp dport (139 445) ACCEPT; #smbd
29         proto udp dport (137:138) ACCEPT; #nmbd
31         # NFSv4
32         proto tcp dport sunrpc ACCEPT;
33         proto (tcp udp) dport 2049 ACCEPT;
35         # reject the rest gracefully
36         REJECT;
37     }
39     # outgoing connections are not limited
40     chain OUTPUT policy ACCEPT;
42     # this is not a router
43     chain FORWARD policy DROP;