I know of ls /sys/class/net
to get all the available IP interface names, and also cat /proc/net/fib_trie
to get all the IP addresses, but how do I match between them?
My desired result is a list of IP interface names and the IP address assigned to every interface name, similar to the info showed by ifconfig
but that can be applied on any Linux distribution.
for example:
enp4s0f1 5.6.7.1
enp6s0 2.2.2.1
https://stackoverflow.com/questions/5281341/get-local-network-interface-addresses-using-only-proc – Ivan Onushkin Aug 12 '20 at 16:55