Get the interface on which the specified IP resides.
npm install --save interface-for-ip
const interfaceForIp = require('interface-for-ip')
const iface = interfaceForIp('192.168.52.219')
console.log(iface)
// { name: 'en0',
// address: '192.168.50.215',
// netmask: '255.255.240.0',
// family: 'IPv4',
// mac: '48:d7:05:00:00:00',
// internal: false }
Returns the interface on which the specified IP resides, or null
if not found.
Interface
has the following properties:
-
name
(string) -
address
(string) -
netmask
(string) -
family
(string) -IPv4
orIPv6
-
mac
(string) -
internal
(boolean)
Currently not implemented :(