When a manufacturer creates a network capable piece of hardware they will assign the MAC address which will usually begin with a code that is tied to the manufacturer. The MAC address will be unique to every device, even two devices of the same type.
A device’s MAC address is composed of six pairs of hexadecimal numbers. The numbers are separated by colons as in the following example:
00:19:d1:18:ba:a9
Finding MAC Address:
On Ubuntu Linux systems, the ethernet device is typically called eth0. In order to find the MAC address of the Ethernet device, you must type ifconfig -a and look up the relevant info. For example:
ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:19:d1:18:ba:a9
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::209:d2fe:fx18:baa6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15973 errors:0 dropped:0 overruns:0 frame:0
TX packets:18361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10261186 (10.2 MB) TX bytes:5729714 (5.7 MB)
Interrupt:21 Base address:0xde00
The MAC address is the HWaddr listed on the first line. In the case of this machine, it is 00:19:d1:18:ba:a9
Changing MAC Address:
To change MAC address setting, you need to edit the /etc/network/interfaces file.
sudo gedit /etc/network/interfacesYou should see the line for your network interface, which is usually eth0. If you have dhcp enabled, it will look like this:
auto eth0Just add another line below it to make it look something like this:
iface eth0 inet dhcp
auto eth0Obviously you would want to choose something else for the MAC address, but it needs to be in the same format. You will need to restart networking or reboot to take effect.
iface eth0 inet dhcp
hwaddress ether 01:02:03:04:05:06
sudo /etc/init.d/networking restart
2 comments:
waaaay easier:
sudo ifconfig eth0 down (eth0 or eth1, whatever device mac you wanna change)
sudo ifconfig eth0 hw ether 00:00:00:00:00:00 (choose your mac here)
sudo ifconfig eth0 up
Useful info for Ubuntu, thanks.
I've got a similar one for checking the MAC address in CentOS.
Post a Comment