Post what you did, and someone may be able to help define how to do it with the templating system.
Have really not get started yet, and there will bee neded to do a lot more before the templatesystem (I believe).
#!/bin/sh
#Enabeling and configuring the third NIC
ifconfig eth2 up
ifconfig eth2 10.0.1.1 netmask 255.255.255.0
LAN="eth0"
WAN="eth1"
DMZ="eth2"
EXTIP="80.90.100.110"
INTIP="10.0.0.1"
DMZIP="10.0.1.1"
# Moduler
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
modprobe ip_nat_irc
# Flush and reset old rules.
iptables -t nat -F POSTROUTING
iptables -t nat -F PREROUTING
iptables -t nat -F OUTPUT
iptables -F
#iptables -X rate-burst
#iptables -X rate-burst2
#iptables -F rate-burst
#iptables -F rate-burst2
# Setting policies, default rules.
# All ports to closed.
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
#Limit on burst and rate for dos attach on internal servers.
#iptables -N rate-burst-input
#iptables -A INPUT -p tcp --syn -j rate-burst-input
#iptables -A syn-flood -m limit --limit 50/s --limit-burst 80 -j RETURN
#iptables -A syn-flood -j DROP
#Limit on burst and rate for dos attach on gateway processes.
#iptables -N rate-burst-forward
#iptables -A FORWARD -p tcp --syn -j rate-burst-forward
#iptables -A syn-flood -m limit --limit 50/s --limit-burst 80 -j RETURN
#iptables -A syn-flood -j DROP
# Filter out non valid tcp-flags
iptables -A FORWARD -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A FORWARD -p tcp --tcp-flags ALL ALL -j DROP
iptables -A FORWARD -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
iptables -A FORWARD -p tcp --tcp-flags ALL NONE -j DROP
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
iptables -A FORWARD -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
# Filter out non valid tcp-flags
iptables -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
# A outgoing nat connection via eth1
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
# Openin up to the local processes on the firewall/gateway pc
iptables -A INPUT -i lo -j ACCEPT
# Drop packets from some certain bad source ip's
iptables -A INPUT -i $WAN -s 123.123.123.123 -j DROP
iptables -A FORWARD -i $WAN -s 123.123.123.123 -j DROP
#From internet WAN to the gateway processes:
iptables -A INPUT -i $WAN -d $EXTIP -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i $WAN -d $EXTIP -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i $WAN -d $EXTIP -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -i $WAN -p udp --dport 5060 -j ACCEPT
iptables -A INPUT -i $WAN -p udp --dport 10000:20000 -j ACCEPT
iptables -A INPUT -i $WAN -p udp --dport 4569 -j ACCEPT
#From LAN to the gateway processes
iptables -A INPUT -i $LAN -d $INTIP -p tcp --dport 22 -s 10.0.0.0/24 -j ACCEPT #ssh
iptables -A INPUT -i $LAN -d $INTIP -p tcp --dport 80 -s 10.0.0.0/24 -j ACCEPT #http
iptables -A INPUT -i $LAN -d $INTIP -p tcp --dport 443 -s 10.0.0.0/24 -j ACCEPT #https
iptables -A INPUT -i $LAN -d $INTIP -p tcp --dport 3128 -s 10.0.0.0/24 -j ACCEPT #Squid
iptables -A INPUT -i $LAN -d $INTIP -p udp --dport 53 -s 10.0.0.0/24 -j ACCEPT #Dns
iptables -A INPUT -i $LAN -p icmp --icmp-type echo-request -s 10.0.0.0/24 -j ACCEPT #Ping
iptables -A INPUT -i $LAN -p udp --dport 5060 -j ACCEPT
iptables -A INPUT -i $LAN -p udp --dport 10000:20000 -j ACCEPT
iptables -A INPUT -i $LAN -p udp --dport 4569 -j ACCEPT
#From DMZ to the gateway processes
iptables -A INPUT -i $DMZ -p tcp --dport 22 -s 10.0.1.0/24 -j ACCEPT #ssh
iptables -A INPUT -i $DMZ -p tcp --dport 80 -s 10.0.1.0/24 -j ACCEPT #http
iptables -A INPUT -i $DMZ -p tcp --dport 443 -s 10.0.1.0/24 -j ACCEPT #https
iptables -A INPUT -i $DMZ -p tcp --dport 3128 -s 10.0.1.0/24 -j ACCEPT #Squid
iptables -A INPUT -i $DMZ -p udp --dport 53 -s 10.0.1.0/24 -j ACCEPT #Dns
iptables -A INPUT -i $DMZ -p icmp --icmp-type echo-request -s 10.0.0.0/24 -j ACCEPT #Ping
#iptables -A INPUT -i $LAN -j ACCEPT #OPEN FOR ALL TRAFFIC#######
#iptables -A INPUT -i $DMZ -j ACCEPT #OPEN FOR ALL TRAFFIC#######
#Statefull inspection for the input to the local processes on the gateway.
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#Control the datatraffic out from the gateway local processes
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -j ACCEPT #ALL OPEN#####
# Statefull inspection out from the gateway local processes
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Outgoing trafick from Lan to internet:
# filtering from lan to internet
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 21 -j ACCEPT #telnet
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 22 -j ACCEPT #ssh
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 23 -j ACCEPT #ftp
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 53 -j ACCEPT #dns oppslag
iptables -A FORWARD -i $LAN -o $WAN -p udp --dport 53 -j ACCEPT #dns oppslag
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 80 -j ACCEPT #http web
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 110 -j ACCEPT #pop3
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 119 -j ACCEPT #news
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 143 -j ACCEPT #imap
iptables -A FORWARD -i $LAN -o $WAN -p tcp --dport 443 -j ACCEPT #https web
iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT #OPEN FOR ALL TRAFFIC########
#Incomming traffic from internet to lan server functions.
iptables -A FORWARD -i eth1 -p tcp --dport 4662 -j ACCEPT
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 4662 -j DNAT --to-destination 10.0.0.202
iptables -A FORWARD -i eth1 -p udp --dport 4672 -j ACCEPT
iptables -t nat -A PREROUTING -i $WAN -p udp --dport 4672 -j DNAT --to-destination 10.0.0.202
# Traffic from lan to dmz server funtions
iptables -A FORWARD -i $LAN -o $DMZ -p tcp --dport 25 -j ACCEPT #smtp mail
iptables -A FORWARD -i $LAN -o $DMZ -p tcp --dport 110 -j ACCEPT #pop3
iptables -A FORWARD -i $LAN -o $DMZ -p tcp --dport 143 -j ACCEPT #imap
# Statefull inspection for all traffic trough the FORWARD chain.
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# Traffic from internet to DMZ:
iptables -A FORWARD -i $WAN -o $DMZ -p tcp --dport 25 -j ACCEPT #smtp mail server
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 25 -j DNAT --to-destination 10.0.1.2
iptables -A FORWARD -i $WAN -o $DMZ -p tcp --dport 110 -j ACCEPT #pop3 server
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 110 -j DNAT --to-destination 10.0.1.2
iptables -A FORWARD -i $WAN -o $DMZ -p tcp --dport 143 -j ACCEPT #imap server
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 143 -j DNAT --to-destination 10.0.1.2
iptables -A FORWARD -i $WAN -o $DMZ -p tcp --dport 465 -j ACCEPT #ssl-smtp server
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 465 -j DNAT --to-destination 10.0.1.2
iptables -A FORWARD -i $WAN -o $DMZ -p tcp --dport 993 -j ACCEPT #ssl-imap server
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 993 -j DNAT --to-destination 10.0.1.2
iptables -A FORWARD -i $WAN -o $DMZ -p tcp --dport 995 -j ACCEPT #ssl pop3 server
iptables -t nat -A PREROUTING -i $WAN -p tcp --dport 995 -j DNAT --to-destination 10.0.1.2
# Traffic from dmz to internet:
iptables -A FORWARD -i $DMZ -o $WAN -p tcp --dport 21 -j ACCEPT #ftp client
iptables -A FORWARD -i $DMZ -o $WAN -p tcp --dport 25 -j ACCEPT #smtp mail
iptables -A FORWARD -i $DMZ -o $WAN -p tcp --dport 53 -j ACCEPT #dns client
iptables -A FORWARD -i $DMZ -o $WAN -p udp --dport 53 -j ACCEPT #dns client
iptables -A FORWARD -i $DMZ -o $WAN -p tcp --dport 80 -j ACCEPT #http client
iptables -A FORWARD -i $DMZ -o $WAN -p tcp --dport 110 -j ACCEPT #pop client
# aktiverer ip forwarding #
echo 1 > /proc/sys/net/ipv4/ip_forward