From: Mark Wooding Date: Sun, 11 Mar 2012 05:23:50 +0000 (+0000) Subject: Merge branch 'master' into emergency X-Git-Url: https://git.distorted.org.uk/~mdw/firewall/commitdiff_plain/c8dab9d26762658a6ba0b34c5598b589ae2652d3?hp=216285e1f550316101d0c49d4420664a5dc74963 Merge branch 'master' into emergency * master: local.m4: Fix the `safe' network prefix length. local.m4: Define the IPv6 network structure. local.m4: Add routes to/from the `safe' network. local.m4: The VPN will be available through the colo. functions.m4: Correct defaulting of IPv6 host addresses. Conflicts: local.m4 --- diff --git a/local.m4 b/local.m4 index f139f00..4385223 100644 --- a/local.m4 +++ b/local.m4 @@ -90,13 +90,14 @@ defhost artist iface eth1 dmz unsafe defhost vampire router - iface eth0.0 dmz unsafe safe - iface eth0.1 dmz unsafe safe + iface eth0.0 dmz unsafe safe default + iface eth0.1 dmz unsafe safe default iface eth0.2 safe - iface eth0.3 untrusted + iface eth0.3 untrusted default iface dns0 dns iface vpn-+ vpn iface vpn-precision colobdry vpn + iface t6-he default defhost ibanez iface br-dmz dmz unsafe iface br-unsafe unsafe diff --git a/numbers.m4 b/numbers.m4 index d5ab0c1..c94ae5f 100644 --- a/numbers.m4 +++ b/numbers.m4 @@ -49,6 +49,7 @@ defport rsync 873 defport imaps 993 defport h323 1720 defport squid 3128 +defport rdesktop 3389 defport tripe 4070 defport siplo 5000 defport siphi 5100 diff --git a/vampire.m4 b/vampire.m4 index fa79ee2..4e00a49 100644 --- a/vampire.m4 +++ b/vampire.m4 @@ -31,6 +31,7 @@ allowservices inbound tcp \ dns iodine \ ssh \ smtp submission \ + rdesktop \ gnutella_svc \ ftp ftp_data \ rsync \ @@ -70,5 +71,38 @@ run iptables -A OUTPUT -m multiport \ dnsresolver inbound ntpclient inbound $ntp_servers +## IPv6 6-in-4 tunnel. +run iptables -A inbound -j ACCEPT \ + -p $proto_ipv6 -s 216.66.80.26 + +## NAT for RFC1918 addresses. +for i in PREROUTING OUTPUT POSTROUTING; do + run iptables -t nat -P $i ACCEPT 2>/dev/null || : + run iptables -t nat -F $i 2>/dev/null || : +done +run iptables -t nat -F +run iptables -t nat -X + +run iptables -t nat -N outbound +run iptables -t nat -A outbound -j RETURN ! -o eth0.0 +run iptables -t nat -A outbound -j RETURN ! -s 172.29.198.0/23 +run iptables -t nat -A outbound -j RETURN -d 62.49.204.144/28 +run iptables -t nat -A outbound -j RETURN -d 172.29.198.0/23 +run iptables -t nat -A outbound -j SNAT --to-source 62.49.204.158 +run iptables -t nat -A POSTROUTING -j outbound + +## Set up NAT protocol helpers. In particular, SIP needs some special +## twiddling. +run modprobe nf_conntrack_sip \ + ports=5060 \ + sip_direct_signalling=0 \ + sip_direct_media=0 +for p in ftp sip h323; do + run modprobe nf_nat_$p +done + +## Forbid anything complicated to the NAT address. +run iptables -A INPUT -d 62.49.204.158 ! -p icmp -j REJECT + m4_divert(-1) ###----- That's all, folks --------------------------------------------------