first commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const os = require('os');
|
||||
|
||||
function getNetworkInterfaces () {
|
||||
const interfaces = os.networkInterfaces();
|
||||
console.log(interfaces)
|
||||
for (const interface in interfaces) {
|
||||
for (const config of interfaces[interface]) {
|
||||
if (config.family === 'IPv4' && !config.internal && interface == 'WLAN') {
|
||||
const mac = config.mac.replace(/:/g, '');
|
||||
console.log(`${interface}: ${config.address}`);
|
||||
console.log(`MAC Address: ${mac}`);
|
||||
console.log(`Subnet Mask: ${config.netmask}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
getNetworkInterfaces();
|
||||
Reference in New Issue
Block a user