### -*-sh-*- ### ### Firewall configuration for mango ### ### (c) 2008 Mark Wooding ### ###----- Licensing notice --------------------------------------------------- ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU General Public License as published by ### the Free Software Foundation; either version 2 of the License, or ### (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU General Public License for more details. ### ### You should have received a copy of the GNU General Public License ### along with this program; if not, write to the Free Software Foundation, ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ###-------------------------------------------------------------------------- ### mango-specific rules. m4_divert(86)m4_dnl ## Externally visible services. allowservices inbound tcp \ ssh allowservices inbound udp \ tripe ## Other interesting things. dnsresolver inbound ## Trust the surrounding environment. run iptables -A INPUT -j ACCEPT -s 10.165.27.0/24 ## NAT for remote administration. 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 -A POSTROUTING -j SNAT --to-source 10.165.27.3 \ -s 172.29.198.0/23 -d 10.165.27.0/24 -o eth0 clearchain nat:portfwd run iptables -t nat -A portfwd -j DNAT \ -p tcp --dport 3128 --to-destination 172.29.199.228 for c in OUTPUT PREROUTING; do run iptables -t nat -A $c -j portfwd \ -s 10.165.27.0/24 -d 10.165.27.3 done m4_divert(-1) ###----- That's all, folks --------------------------------------------------