Find gateway address and netmask?
With ifconfig on OS X you can find netmask :

inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255


netmask 0xffffff00 means 255.255.255.0

And for finding gateway address use arp -a or as geekosaur said use netstat -nr | grep '^default'.