Is it possible to somehow display the MAC addresses of all network interfaces for systems that have an IP address in the subnets of the source system (that is, the one on which the script is running)? Using ssh or rsh .
How to get the subnet I found on the Internet:
subnets=(` ifconfig -a | grep broadcast | gawk '{print $2}'`) I thought to use the ifconfig command, but on the network they write the following:
The results of the
ifconfig -аcommand will vary depending on who calls it: the root user or a row user. This applies to both versions of the command. In the first case, besides IP addresses and parameters, MAC addresses are also displayed.
I need the script to be launched on behalf of a regular user, and not just from the root. And how to combine all this into a single script? I need for OS Solaris . Will there be differences in the work, for example, from running on Ubuntu ?