A masquerade is usually setup using iptables. Here's a short script that would do most of what you need.
Code:
echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
EXTIF="eth0"
INTIF="eth1"
iptables -P INPUT DROP
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -F -t nat
iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
Mostly taken from here
http://tldp.org/HOWTO/IP-Masquerade-...-examples.html.
That should be all you need for the initial setup. If you need more like port forwarding, you should read through the howto. Just know that the main part of a masquerade is
Code:
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
You will also need to setup dhcpd on BOX if you want any computer connected to be setup automatically.