Fix for automatic gateway interface IP calculation

* Previously this would return the ip address of the default gateway NOT the interface