I have few computer labs to manage, so I setup a DHCP server using Linux Fedora Core 3. The DHCP service working after I configured the setting. I configure the network in one network card with:
IP :
Netmask :
Gateway :

IP :
Netmask :

All the labs will get the and so on. For lab 1 will get to Lab 2 will get to Lab 3 will get to and so on. All the labs PC can get the IP that assigned by DHCP Server but all cannot connect to internet. So I used ping command at DHCP Server and it was showing response from internet.

My friends said had to write the script to command it to route the line. So I search internet and I found some routing script and put on it and run the script, here the script:
echo "1" > /proc/sys/net/ipv4/ip_forward

EXTIP="`$IFCONFIG $EXTIF | awk /$EXTIF/'{next}//{split ($0,a,":");split (a[2],a," ");print a[1];exit}'`"

echo $EXTIP

iptables -F
iptables -X

iptables -A FORWARD -i eth0 -o $EXTIF -j ACCEPT
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT

After I run this script, all the labs can connect to internet. That was good.
Now I want to manage the labís internet connection. I donít want to enable the internet connection to all the labs. Example I got 1 to 5 labs, I only want to enable Lab 1 and Lab3 internet services and other are disable. How should write the script to control it?