Skip to main content

Find/Display your MAC Address Linux/UNIX

How to find/display your MAC Address:Unix/Linux



Linux

  • As the root user (or user with appropriate permissions)
  • Type "ifconfig -a"
  • From the displayed information, find eth0 (this is the default first Ethernet adapter)
  • Locate the number next to the HWaddr. This is your MAC address
The MAC Address will be displayed in the form of00:08:C7:1B:8C:02.
Example "ifconfig -a" output:
eth0      Link encap:Ethernet HWaddr 00:08:C7:1B:8C:02
          inet addr:192.168.111.20  Bcast:192.168.111.255  Mask:255.255.255.0

...additional output removed...

Solaris/SunOS

  • As the root user (or user with appropriate permissions)
  • Type "/sbin/ifconfig -a"
  • From the displayed information, find the Ethernet adapter (it will probably be called le0 or ie0)
  • Locate the number next to ether. This is your MAC address
The MAC Address will be displayed in the form of 0:3:ba:26:1:b0-- leading zeros are removed. For this example, the actual MAC Address would be 00:03:ba:26:01:b0.
Example "ifconfig -a" output:
le0: flags=863 mtu 1500
     inet 192.168.111.30 netmask ffffff00 broadcast 192.168.111.255
     ether 0:3:ba:26:1:b0

FreeBSD/NetBSD

  • As the root user (or user with appropriate permissions)
  • Type "ifconfig -a"
  • From the displayed information, find the Ethernet adapter (the name changes based on the Ethernet card installed)
  • Locate the number next to the HWaddr. This is your MAC address
The MAC Address will be displayed in the form of00:08:C7:1B:8C:02.
(Using the command"dmesg"will also display the MAC address -- along with a lot of other information)
Example "ifconfig -a" output:
    ed0: flags=8843 mtu 1500
         inet 192.168.111.40 netmask 0xffffff00 broadcast 192.168.111.255
         ether 00:08:C7:1B:8C:02

...additional output removed...

OpenBSD

  • As the root user (or user with appropriate permissions)
  • Type "netstat -in"
  • From the displayed information, find the Ethernet adapter (the name changes based on the Ethernet card installed)
  • Locate the number below Address. This is your MAC address
The MAC Address will be displayed in the form of00:08:c7:1b:8c:02.
Example "netstat -in" output:
Name  Mtu  Network  Address           Ipkts    Ierrs Opkts   Oerrs Colls
fxp0  1500 <Link>   00:08:c7:1b:8c:02 4112773  0     224501  0     0

...additional output removed...

Caldera/SCO UnixWare/OpenUNIX

  • As the root user (or user with appropriate permissions)
  • Type "ndstat"
  • From the displayed information, find net0 (this is the default first Ethernet adapter)
  • Locate the number below MAC Address in use. This is your MAC address
The MAC Address will be displayed in the form of00:00:c0:88:0a:2e.
Example "ndstat" output:
   Device       MAC address in use    Factory MAC Address
   ------       ------------------    -------------------
   /dev/net0    00:00:c0:88:0a:2e     00:00:c0:88:0a:2e

...additional output removed...

HP-UX (HP UNIX)

  • As the root user (or user with appropriate permissions)
  • Type "/usr/sbin/lanscan"
  • From the displayed information, find lan0 (this is the default first Ethernet adapter)
  • Locate the number below Address. This is your MAC address
The MAC Address will be displayed in the form of0x000E7F0D81D6 -- the leading hexadecimal indicator should be removed. For this example, the actual MAC Address would be00:0E:7F:0D:81:D6.
Example "lanscan" output:
Hardware Station        Dev Hardware Net-Interface   NM  Encapsulation      Mjr
Path     Address        lu  State    NameUnit State  ID  Methods            Num
2.0.2    0x000E7F0D81D6 0   UP       lan0     UP     4   ETHER              52

...additional output removed...

IRIX (SGI UNIX)

  • IRIX 4.01 or later
    • As the root user (or user with appropriate permissions)
    • Type "netstat -ia"
    • From the displayed information, find the Ethernet adapter (the name changes based on the Ethernet card installed)
    • Locate the number below Address. This is your MAC address
  • Alternate Method
    • Typing "/etc/nvram eaddr" should also show the MAC address
The MAC Address will be displayed in the form of00:00:6b:71:1a:6a.
Example "netstat -ia" output:
Name  Mtu    Network   Address            Ipkts   Ierrs   Opkts  Oerrs  Coll
ec0   1500   nowhere   warum              6514913 10234  184317     0  13513
                       192.168.111.90
                       00:00:6b:71:1a:6a
...additional output removed...

NeXTStep

  • As the root user (or user with appropriate permissions)
  • Type "/sbin/ifconfig -a"
  • From the displayed information, find the Ethernet adapter (it will probably be called le0 or ie0)
  • Locate the number next to ether. This is your MAC address
The MAC Address will be displayed in the form of 0:0:f:a1:75:a0-- leading zeros are removed. For this example, the actual MAC Address would be 00:00:0f:a1:75:a0.
Example "ifconfig -a" output:
le0: flags=863 mtu 1500
     inet 192.168.111.70 netmask ffffff00 broadcast 192.168.111.255
     ether 0:0:f:a1:75:a0

AIX (IBM UNIX)

  • As the root user (or user with appropriate permissions)
  • Type "netstat -ia"
  • From the displayed information, find the Ethernet adapter (the name changes based on the Ethernet card installed)
  • Locate the number below Address. This is your MAC address
The MAC Address will be displayed in the form of00:09:6B:51:1f:79.
Example "netstat -ia" output:
Name  Mtu    Network   Address            Ipkts   Ierrs   Opkts  Oerrs  Coll
ec0   1500   nowhere   flotsam              5514233 11434  101317     0  14113
                       192.168.111.95
                       00:09:6B:51:1f:79
...additional output removed...

Tru64 UNIX (Digital UNIX)

  • As the root user (or user with appropriate permissions)
  • Type "netstat -ia"
  • From the displayed information, find the Ethernet adapter (the name changes based on the Ethernet card installed)
  • Locate the number below Address. This is your MAC address
The MAC Address will be displayed in the form of>00:00:F8:1a:73:da.
Example "netstat -ia" output:
Name  Mtu    Network   Address            Ipkts   Ierrs   Opkts  Oerrs  Coll
ec0   1500   nowhere   jetsam              5514233 11434  101317     0  14113
                       192.168.111.95
                       00:00:F8:1a:73:da
...additional output removed...

Comments

Popular posts from this blog

Interpreting the output of lspci

On Linux, the lspci command lists all PCI devices connected to a host (a computer). Modern computers and PCI devices communicate with each other via PCI Express buses instead of the older Conventional PCI and PCI-X buses since the former buses offer many advantages such as higher throughput rates, smaller physical footprint and native hot plugging functionality. The high performance of the PCI Express bus has also led it to take over the role of other buses such as AGP ; it is also expected that SATA buses too will be replaced by PCI Express buses in the future as solid-state drives become faster and therefore demand higher throughputs from the bus they are attached to (see this article for more on this topic). As a first step, open a terminal and run lspci without any flags (note: lspci may show more information if executed with root privileges): lspci   This is the output I get on my laptop: 00:00.0 Host bridge: Intel Corporation Haswell-ULT DRA...

Boot process hangs at dracut: Switching root

Environment Red Hat Enterprise Linux 6 Issue When server is booting the boot process hangs at  dracut: Switching root , and never displays anything else. Raw device-mapper: ioctl: 4.33.1-ioctl (2015-8-18) initialised: xx-xxxx@redhat.com udev: starting version 147 dracut: Starting plymouth daemon dracut: rd_NO_DM: removing DM RAID activation dracut: rd_NO_MD: removing MD RAID activation scsi0 : ata_piix scsi1 : ata_piix ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc120 irq 14 ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc128 irq 15 Refined TSC clocksource calibration: 2599.999 MHz. virtio-pci 0000:00:03.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, high) -> IRQ 11 virtio-pci 0000:00:05.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, high) -> IRQ 10 virtio-pci 0000:00:07.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, high) -> IRQ 11 virtio-pci 0000:00:08.0: PCI INT A -> Link[LNKD] -> GSI 11 (level, high) -> IRQ 11 input: ImExPS/2 G...

How to Remove a Storage Device (LUN)

Before removing access to the storage device itself, it is advisable to back up data from the device first. Afterwards, flush I/O and remove all operating system references to the device. Stop all access to the device that has to be removed. Unmount the device. Remove the device from any md and LVM volume that is using it. If a multipath device is being removed, run  multipath -l  and take note of all the paths to the device. When this has been done, remove the multipath device: # multipath -f device   Use the following command to flush any outstanding I/O to all paths to the device: # blockdev –flushbufs device   Remove any reference to the device's path-based name, like  /dev/sd  or  /dev/disk/by-path  or the major:minor number, in applications, scripts, or utilities on the system. This is important to ensure that a different device, when added in the future, will not be mistaken for the current device. The fi...