title: How do i get the default gateway in LINUX given the destination?
body: <p>I'm trying to get the default gateway, using the destination <code>0.0.0.0</code></p>
  
  <p>I used this command: <code>netstat -rn | grep 0.0.0.0</code></p>
  
  <p>And it returned this list:</p>
  
  <pre><code>**Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface&lt;br&gt;
  10.9.9.17       0.0.0.0         255.255.255.255 UH        0 0          0 tun0&lt;br&gt;
  133.88.0.0      0.0.0.0         255.255.0.0     U         0 0          0 eth0&lt;br&gt;
  0.0.0.0         133.88.31.70    0.0.0.0         UG        0 0          0 eth0**&lt;br&gt;
  </code></pre>
  
  <p>My goal here is to ping the default gateway using destination <code>0.0.0.0</code>;
  thus, that is <code>133.88.31.70</code>; but this one returns a list because of using <code>grep</code>.</p>
  
  <p>How do i get the default gateway only? I will need it for my bash script to identify if net connection is up or not.</p>