jackpal / gateway

A golang library for discovering the address of a LAN gateway.
BSD 3-Clause "New" or "Revised" License
227 stars 69 forks source link

adding support for getting the information with ip and not route #1

Closed chmduquesne closed 9 years ago

chmduquesne commented 9 years ago

Here is a patch for getting the gateway using the command 'ip route show' on linux, when 'route -n' fails.

The reason for this patch is that on my system, route is not installed by default, but 'ip' is. 'ip' seems to be the new standard tool for managing the network, so I think it would nice to include it.

jackpal commented 9 years ago

Looks good. I'm going to fix the capitalization of "gateway" in a follow up commit.