About nixCraft

Topics

Linux or UNIX: How to find out or display the Ethernet Address (MAC)

Posted by Vivek Gite [Last updated: September 21, 2006]

Media Access Control (MAC) address is a unique identifier attached to most networking devices (such as router, Ethernet cards etc).

This address is some time required. For example, there is famous engineering expensive software. This software needs your unique MAC address to issue you license and necessary software installation keys. Some time MAC address used for filtering purpose (firewall or sniffers) or diagnosing network problems .

Task: Find out my Mac address

Use arp command.
$ arpOutput:

Address                  HWtype  HWaddress           Flags Mask            Iface
vpn.dhcp.cyberciti.org   ether   00:76:C7:76:F0:01   C                     eth0
desktop.cyberciti.org    ether   00:08:5C:00:00:01   C                     ra0

$ arp -nOutput:

Address                  HWtype  HWaddress           Flags Mask            Iface
10.5.123.1               ether   00:76:C7:76:F0:01   C                     eth0
192.168.1.5              ether   00:08:5C:00:00:01   C                     ra0

arp manipulates the kernel's ARP cache in various ways. The primary options are clearing an address mapping entry and manually setting up one. arp command works under

Where,

Task: Changing MAC addresses

Please note that physical MAC addresses are permanent, but several mechanisms allow modification (read as spoofing) of the MAC address that is reported by the operating system.

Under Linux you can type the command to setup a new MAC address :
# ifconfig eth0 down
# ifconfig eth0 hw ether 01:02:03:04:05:06

Where,

If you are using FreeBSD type the command:
# ifconfig nc0 ether 01:02:03:04:05:06

If you are using OpenBSD or Mac OS X type the command:
# ifconfig nc0 lladdr 01:02:03:04:05:06

If you are using Windows 2003/XP:
Under Windows XP or 2003 server the MAC address can be changed in the Ethernet adapter's Properties menu > Advanced tab > Look for MAC Address > Locally Administered Address > Ethernet Address > Physical Address option.

Also, note that some ISP's use MAC addresses to control the access (this is rare case these days). Therefore, if you change MAC address you may lose the connectivity.

E-mail this to a friend      Printable version

You may also be interested in other helpful articles:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.