I think that part of the response can be found in this post:
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=3714and more precisely here:
http://startu.net/chilli/setup.html I don't think you need to follow the entire procedure. (I think it is outdated and too complex...)
I don't know iptables also. But these lines seems to be interesting:
$IPTABLES -t nat -A POSTROUTING -o vlan1 -s 192.168.0.0/16 -j MASQUERADE
$IPTABLES -A INPUT -i lo -m state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -o lo -m state --state NEW -j ACCEPT
echo "Rule 0 (tun0)"
#
$IPTABLES -N Cid44F4A009.0
$IPTABLES -A INPUT -i tun0 -d 255.255.255.255 -m state --state NEW -j Cid44F4A009.0
$IPTABLES -A Cid44F4A009.0 -p udp -m udp -m multiport --dports 68,67 -j ACCEPT
$IPTABLES -N Cid44F4A009.1
$IPTABLES -A OUTPUT -o tun0 -d 255.255.255.255 -m state --state NEW -j Cid44F4A009.1
$IPTABLES -A Cid44F4A009.1 -p udp -m udp -m multiport --dports 68,67 -j ACCEPT
$IPTABLES -N Cid44F4A009.2
$IPTABLES -A FORWARD -o tun0 -d 255.255.255.255 -m state --state NEW -j Cid44F4A009.2
$IPTABLES -A Cid44F4A009.2 -p udp -m udp -m multiport --dports 68,67 -j ACCEPT
echo "Rule 1 (tun0)"
#
$IPTABLES -N Cid44F49FBE.0
$IPTABLES -A INPUT -i tun0 -s 192.168.182.0/24 -m state --state NEW -j Cid44F49FBE.0
$IPTABLES -A Cid44F49FBE.0 -p tcp -m tcp --dport 53 -j ACCEPT
$IPTABLES -A Cid44F49FBE.0 -p udp -m udp --dport 53 -j ACCEPT
$IPTABLES -N Cid44F49FBE.1
$IPTABLES -A FORWARD -i tun0 -s 192.168.182.0/24 -m state --state NEW -j Cid44F49FBE.1
$IPTABLES -A Cid44F49FBE.1 -p tcp -m tcp --dport 53 -j ACCEPT
$IPTABLES -A Cid44F49FBE.1 -p udp -m udp --dport 53 -j ACCEPT
echo "Rule 2 (tun0)"
#
$IPTABLES -A INPUT -i tun0 -s 192.168.182.0/24 -d 192.168.182.255 -m state --state NEW -j ACCEPT
$IPTABLES -A INPUT -i tun0 -s 192.168.182.0/24 -d 192.168.182.1 -m state --state NEW -j ACCEPT
echo "Rule 3 (tun0)"
#
$IPTABLES -N Cid44F49FF3.0
$IPTABLES -A INPUT -i tun0 -s 192.168.182.0/24 -j Cid44F49FF3.0
$IPTABLES -A Cid44F49FF3.0 -d 10.0.0.0/8 -j DROP
$IPTABLES -A Cid44F49FF3.0 -d 192.168.0.0/16 -j DROP
$IPTABLES -A Cid44F49FF3.0 -d 172.16.0.0/12 -j DROP
$IPTABLES -N Cid44F49FF3.1
$IPTABLES -A FORWARD -i tun0 -s 192.168.182.0/24 -j Cid44F49FF3.1
$IPTABLES -A Cid44F49FF3.1 -d 10.0.0.0/8 -j DROP
$IPTABLES -A Cid44F49FF3.1 -d 192.168.0.0/16 -j DROP
$IPTABLES -A Cid44F49FF3.1 -d 172.16.0.0/12 -j DROP
echo "Rule 5 (tun0)"
#
$IPTABLES -N Cid44F4A041.0
$IPTABLES -A INPUT -i tun0 -s 192.168.182.0/24 -m state --state NEW -j Cid44F4A041.0
$IPTABLES -A Cid44F4A041.0 -p icmp -m icmp --icmp-type 8/0 -j ACCEPT
$IPTABLES -A Cid44F4A041.0 -p tcp -m tcp --dport 5222:5223 -j ACCEPT
$IPTABLES -A Cid44F4A041.0 -p tcp -m tcp -m multiport --dports 22,80,443,5060,143,993,110,995,1812 -j ACCEPT
$IPTABLES -A Cid44F4A041.0 -p udp -m udp --dport 5000:5020 -j ACCEPT
$IPTABLES -A Cid44F4A041.0 -p udp -m udp --dport 8000:8020 -j ACCEPT
$IPTABLES -A Cid44F4A041.0 -p udp -m udp --dport 5060 -j ACCEPT
$IPTABLES -N Cid44F4A041.1
$IPTABLES -A FORWARD -i tun0 -s 192.168.182.0/24 -m state --state NEW -j Cid44F4A041.1
$IPTABLES -A Cid44F4A041.1 -p icmp -m icmp --icmp-type 8/0 -j ACCEPT
$IPTABLES -A Cid44F4A041.1 -p tcp -m tcp --dport 5222:5223 -j ACCEPT
$IPTABLES -A Cid44F4A041.1 -p tcp -m tcp -m multiport --dports 22,80,443,5060,143,993,110,995,1812 -j ACCEPT
$IPTABLES -A Cid44F4A041.1 -p udp -m udp --dport 5000:5020 -j ACCEPT
$IPTABLES -A Cid44F4A041.1 -p udp -m udp --dport 8000:8020 -j ACCEPT
$IPTABLES -A Cid44F4A041.1 -p udp -m udp --dport 5060 -j ACCEPT
echo "Rule 6 (tun0)" From what I understand (again I don't know iptables at all)
rule 0: don't know (nat?)
rule 1:seems to be dhcp related
rule 2:accept all dns accesses (to the external router for example)
rule3:?
rule 4 and 5 is what you ask for.
rule 6: limits chillispot users ports usage.
I repeat, I haven't tested all this!!
The firewall script seems to be stored in the rc_firewall nvram variable.
But It will erased any time you change a firewall setting.
The other simple solution is to replace your external router by DD-WRT and have all your existing network connected to the dd-wrt lan ports.