local.m4: Don't expect `forbidden' to return.
[firewall] / vampire.m4
CommitLineData
775bd287 1### -*-sh-*-
bfdc045d
MW
2###
3### Firewall configuration for vampire
4###
5### (c) 2008 Mark Wooding
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
10### This program is free software; you can redistribute it and/or modify
11### it under the terms of the GNU General Public License as published by
12### the Free Software Foundation; either version 2 of the License, or
13### (at your option) any later version.
14###
15### This program is distributed in the hope that it will be useful,
16### but WITHOUT ANY WARRANTY; without even the implied warranty of
17### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18### GNU General Public License for more details.
19###
20### You should have received a copy of the GNU General Public License
21### along with this program; if not, write to the Free Software Foundation,
22### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24###--------------------------------------------------------------------------
bfdc045d
MW
25### vampire-specific rules.
26
a4d8cae3 27m4_divert(86)m4_dnl
bfdc045d
MW
28## Externally visible services.
29allowservices inbound tcp \
29a9e571 30 ident \
bfdc045d 31 ssh \
fec59143 32 tor_public tor_directory i2p
bfdc045d 33allowservices inbound udp \
bfdc045d 34 tripe \
fec59143
MW
35 gnutella_svc \
36 i2p
bfdc045d 37
d84128ea
MW
38## Extend some services to local untrusted hosts.
39clearchain inbound-untrusted
e2c5d32a
MW
40run iptables -A inbound -j inbound-untrusted -s $net_inet_untrusted
41run ip6tables -A inbound -j inbound-untrusted -s $net_inet6_untrusted
bfdc045d 42
d84128ea
MW
43allowservices inbound-untrusted tcp \
44 dns \
2d2c8f25 45 lpd \
d84128ea
MW
46 netbios_ssn microsoft_ds
47allowservices inbound-untrusted udp \
48 dns \
49 tftp
42e91fdf 50
bfdc045d
MW
51## Provide syslog for evolution.
52run iptables -A inbound -j ACCEPT \
53 -s 172.29.198.2 \
54 -p udp --destination-port $port_syslog
55
d6dd88f5
MW
56## Watch outgoing Tor usage.
57run iptables -A OUTPUT -m multiport \
58 -p tcp --source-ports $port_tor_public,$port_tor_directory
59
bfdc045d
MW
60## Other interesting things.
61dnsresolver inbound
7dde20fa 62dnsserver inbound
1ee6211d 63ntpclient inbound $ntp_servers
bfdc045d 64
f5a0901e
MW
65## Provide NTP service to untrusted clients.
66iptables -A inbound -p udp -j ACCEPT \
67 --source-port 123 --destination-port 123 \
68 -s 172.29.198.0/23
69ip6tables -A inbound -p udp -j ACCEPT \
70 --source-port 123 --destination-port 123 \
295959ea
MW
71 -s 2001:ba8:1d9::/48
72ip6tables -A inbound -p udp -j ACCEPT \
73 --source-port 123 --destination-port 123 \
74 -s 2001:8b0:c92::/48
f5a0901e 75
bfdc045d
MW
76m4_divert(-1)
77###----- That's all, folks --------------------------------------------------