ifconfig-defaultgateway
v0.1.2
Published
ifconfig-defaultgateway is a node.js library to parse ifconfig and get the default gateaway on a linux machine
Downloads
3
Readme
ifconfig-defaultgateway
ifconfig-defaultgateway is a node.js library to parse ifconfig and get the default gateway on a linux machine.
Currently only tested on Debian (Raspberry Pi)
Install
You can install ifconfig-defaultgateway using the Node Package Manager (npm):
npm install ifconfig-defaultgateway
Examples
var network = require('ifconfig-defaultgateway');
network.ifconfig(function (err, interfaces) {
if(err) return console.log(err);
console.log('\nIFCONFIG INTERFACES:\n', interfaces);
});
network.route(function (err, routes) {
if(err) return console.log(err);
console.log('\nROUTE ROUTES:\n', routes);
});
network.getNetworkInfo(function (err, interfaces) {
if(err) return console.log(err);
console.log('\nNETWORK INFO INTERFACES (WITH DEFAULT GATEWAY):\n', interfaces);
});