Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get all the infomation of interafces ? #36

Open
liaodalin19903 opened this issue Aug 6, 2023 · 0 comments
Open

How to get all the infomation of interafces ? #36

liaodalin19903 opened this issue Aug 6, 2023 · 0 comments

Comments

@liaodalin19903
Copy link

Hello,
I use the default method to get the addresses of my PC:

address((err: any, addrs: { ip: any; ipv6: any; mac: any; }) => {
  console.log(addrs.ip, addrs.ipv6, addrs.mac);
  // '192.168.0.2', 'fe80::7aca:39ff:feb0:e67d', '78:ca:39:b0:e6:7d'
});

it can get the IP & IPv6 address and MAC. but it do not get the name of interface,
how to get the all infomation of the interface like below?

en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	options=460<TSO4,TSO6,CHANNEL_IO>
	ether 36:2d:55:6a:38:80 
	media: autoselect <full-duplex>
	status: inactive
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	options=460<TSO4,TSO6,CHANNEL_IO>
	ether 36:2d:55:6a:38:84 
	media: autoselect <full-duplex>
	status: inactive
ap1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=400<CHANNEL_IO>
	ether 3e:a6:f6:07:69:27 
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: inactive
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=6463<RXCSUM,TXCSUM,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
	ether 3c:a6:f6:07:69:27 
	inet6 fe80::14d9:a19:3b15:1726%en0 prefixlen 64 secured scopeid 0xb 
	inet 192.168.2.7 netmask 0xffffff00 broadcast 192.168.2.255
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant