The module currently assumes that the default gateway lies within one of the configured interface subnets but there are cases where this assumption does not hold true. One example is a Travis VM having with gateway . Strictly speaking, this is a invalid network configuration but it somehow still works so we need to account for it. One approach could be to find the address nearest to the gateway. It's a guess but chances are it might be correct. To get the nearest IPv6 adress conveniently, we need to convert both the address CIDR and gateway address to a BigInt and then compare them, so I would like to require native BigInt (node 10.4.0+).
Repository: sindresorhus/internal-ip. Description: Get your internal IP address Stars: 350, Forks: 27. Primary language: JavaScript. License: MIT. Open PRs: 0, open issues: 0. Last activity: 5mo ago. Top contributors: sindresorhus, silverwind, Richienb, shellscape, arthurvr, ChrisCindy, BendingBender, Marsup, Rodrigo54, SamVerschueren.