Its very simple to masquerade in linux with few lines of iptables and ip_forward commands.
Assumptions : Your Linux box has 2 NIC's one connected to internet (eth0) other connected to local network (eth1 IP 192.168.0.10)
first of all you have to flush and delete existing firewall rules which are there by default in linux .
so flush rules by typing the following in terminal
iptables -t nat -F
iptables -t mangle -F
now delete the chains by using
iptables -t nat -X
iptables -t mangle -X
now its time to save iptables so type
service iptables save
service iptables restart
now all rules and chains will clear !
check it by /etc/sysconfig/iptables which has all defaults rules set to accept.
now open /etc/rc.d/rc.local
and insert the following line