How to get the MAC address of the 'local' system given the IP address?

Tom H tomh0665 at gmail.com
Sat Feb 1 15:21:10 UTC 2020


On Fri, Jan 31, 2020 at 3:43 PM Gilles Gravier <ggravier at fsfe.org> wrote:
> Le ven. 31 janv. 2020 à 14:52, Karl Auer <kauer at biplane.com.au> a écrit :
>> On Fri, 2020-01-31 at 06:23 -0500, Little Girl wrote:
>>>
>>> Here's another way to get the LAN IP by using the ip command:
>>> ip route | grep kernel | cut -f1 -d'/'
>>
>> These days, any interface can have multiple IP addresses, and (possibly
>> more importantly in this case) you can have multiple connections to
>> your LAN. I routinely have both wireless and wired connections going at
>> the same time, and not always to the same LAN!
>
> And "ifconfig -a" will give you the MAC for each interface (look for the "ether") parameter...

Both "ifconfig" and "ip a" output the MAC address.




More information about the ubuntu-users mailing list