Just a little something to get you started:
Code:
ipAddress=`/sbin/ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | grep -o '[1-9.]*'`
echo $ipAddress
You can get gateway by netstat -nr, do a little parsing, then just concatenate your variables to get your required format. Let me know if you need more help.