1

In Ubuntu 14.04, when I run the command ifconfig | grep HWaddr to know the mac address of my computer, I find two MAC addresses, how is it possible?

zina@zina-HP-Pavilion-g4-Notebook-PC:~$ ifconfig | grep HWaddr
eth0      Link encap:Ethernet  HWaddr a4:5d:36:71:61:d9  
wlan0     Link encap:Ethernet  HWaddr 24:fd:52:e1:9b:4d  
Parto
  • 15,325
  • 24
  • 86
  • 117
Anil Kumawat
  • 29
  • 1
  • 2
  • Related: http://askubuntu.com/questions/203789/what-is-the-active-mac-address-of-my-computer – Parto Mar 17 '16 at 09:56

1 Answers1

6

MAC addresses belong to network adapters, not computers. Your computer has a wireless interface (wlan0) and a wired interface (eth0). Each has its own MAC address.

If you're connected to a wired network, the MAC address that everyone else sees is the first one. If you're on wireless, it's the second one.

Mark Smith
  • 1,283
  • 1
  • 11
  • 22
  • On running ifconfig | grep HWaddr, I see a third entry besides eth0 and wlan0: pan1 Link encap:Ethernet HWaddr 76:40:d6:7b:56:2b. Any idea what that's about? – DK Bose Mar 17 '16 at 12:16
  • 2
    "the MAC address that everyone else sees"... on the local network, of course, as it won't go any further. – jcaron Mar 17 '16 at 12:47
  • 1
    @DKBose The pan1 interface is a software interface used to bridge the Wifi and LAN connector together (only used when you make a Wifi connection a Wifi router and share this connection with another computer that connects to your laptops wired connector). You may also see hardware-addresses linked to Bluetooth and Firewire connections. These can be used as network interfaces too. – Tonny Mar 17 '16 at 12:47
  • @Tonny, are you sure that pan is used for anything else apart from Bluetooth? – jcaron Mar 17 '16 at 12:49
  • @jcaron With IPv6 that's not entirely true anymore. Self-generated Ipv6 addresses often embed the mac-address. So mac-addresses can get exposed wider than the local LAN, albeit in a non-Ethernet way. – Tonny Mar 17 '16 at 12:50
  • @jcaron Read carefully. I didn't say that. Actually you can use pan also to bridge a Bluetooth nic with another nic. But I explicitly mentioned WiFi to LAN because that is the most common case. – Tonny Mar 17 '16 at 12:52