I\'m trying to get the default gateway, using the destination 0.0.0.0
0.0.0.0
I used this command: netstat -rn | grep 0.0.0.0
netstat -rn | grep 0.0.0.0
And it return
use command below:
route -n | grep '^0\.0\.\0\.0[ \t]\+[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*[ \t]\+0\.0\.0\.0[ \t]\+[^ \t]*G[^ \t]*[ \t]' | awk '{print $2}'