![]() I also needed to get the name of my network interfaces and I'll be using the arp one on my instances that don't know their single network device as well as their whole existance is entirely abstracted. Nobody is paying me so, that is all I have time for today. I only tested my commands on my Kubuntu laptop. Also, find, arp, awk, sed, and sort are generally on every linux device already. spaces, newlines, other weird characters.). Good chance network interfaces are not named in ways that break stuff the usual way (i.e. With a "clean list" of names, you can plug them into most other commands and test for the MAC address of all zeroes or a virtual attribute. It for sure includes my wifi network interface. I am not sure if that gets rid of the "virtual devices". With the arp command, you can specify "ethernet" devices. (explanation: gimme the arp table info | don't print if line 1, which are arp table headers | only print the fifth column | delete empty lines | aphabetize and remove duplicates) The whole code can be found at the bottom. I have spent most of yesterday writing the code, so I decided to describe it here. The information on the internet is not very good, and the process is quite complicated. find /sys/class/net -type l -execdir basename '' | sed '/^$/d'| sort -u Getting IP, IPv6 and MAC addresses on Linux is no easy task if you do not use ifconfig. I came up with two ways I thought were "okay". If you're using Windows, type cmd into the Windows Search bar, right-click Command prompt, and then select Run as administrator. ![]() You can use the arp command on any operating system to find the MAC address of another computer on your network. We need a "clean list of interfaces" that doesn't have the loopback. 1 Open a command prompt or terminal window. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |