-4

Does ifconfig show the MAC address of a network interface following ether?

Does ether mean ethernet? How does it mean Mac address?

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:b1:aa:1f  txqueuelen 1000  (Ethernet)
        RX packets 451  bytes 43572 (43.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 108  bytes 28182 (28.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlx8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.97  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 xx:xx:xx  prefixlen 64  scopeid 0x20<link>
        ether 80:1f:02:b5:c3:89  txqueuelen 1000  (Ethernet)
        RX packets 697657  bytes 564556036 (564.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 374913  bytes 60332457 (60.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
1

As explained in the ifconfig manpage, in the section on setting options,

Set the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware classes currently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).

This also explains the output, i.e. ifconfig shows the current hardware address of the interface, with its hardware class. For Ethernet interfaces, the class is ether and the hardware address is the MAC address.

  • THanks. wlx8 is a wifi network interface, not an ethernet interface. Is the hardware address of a wifi interface also a MAC address? – Tim Mar 24 at 22:14
  • Wi-fi uses Ethernet frames at the link layer, and it uses MAC addresses in the same way. – Stephen Kitt Mar 24 at 22:18
1

Note that different implementations of ifconfig report data in different ways.

For the net-tools version typically found on Linux, the word ether is the hardware class, and the value following that is the hardware address. Both of these can be changed with the ifconfig hw command:

   hw class address
          Set the hardware address of this interface, if the device driver
          supports  this  operation.   The keyword must be followed by the
          name of the hardware class and the printable ASCII equivalent of
          the  hardware  address.   Hardware  classes  currently supported
          include ether (Ethernet), ax25 (AMPR AX.25), ARCnet  and  netrom
          (AMPR NET/ROM).

For the "Ethernet" hardware class the address is the card's MAC address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.