Easy-peasy:

> route -n | grep -v " 0.0.0.0" | grep "eth0" | awk '{print $2}' | head -n 1