I have found a way to get default gateway in Linux with the following command:
grep -i "gateway" /etc/network/interfaces | awk print $2
Output:
192.168.14.1
This will not work if the system is in DHCP mode.
I need a way to get only 'gateway' which works on all platforms (Linux / Windows / Mac).