net.adapters(family) iterator

Iterator function to retrieve installed network adapters on the Windows operating system, using the IPv4 or IPv6 address family.

Parameters

family

A string representing the IP family address returned at each iteration : "ipv4" or "ipv6".

Return value

Returns an iterator function to be used in a for loop, to iterate over network adapters, returning two values at each iteration :
  • A string, representing the name of the adapter.
  • A table, that contains the list of all the IP associated with the adapter.

Example

local net = require "net" print("Available Network adapters :") for name, ip in net.adapters("ipv4") do print(ip[1].."\t"..name) end