Networking - Changing your Mac address

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
Mic67

Networking - Changing your Mac address

#1 Post by Mic67 »

Some may find this helpful.

http://www.debianadmin.com/change-your- ... dress.html

http://www.computing.net/linux/wwwboard ... 28042.html
I understand that it not possible to change the physical MAC address of a network adapter but is it possible to change its MAC address at the software level. I have tried via:

"ifconfig eth0 hw ether 00:4F:49:1D:8B:5E" (for example)

but I get the response "device or resource busy" and the MAC address remains the same.

Does anybody know of an alternative method?

The problem is that the ethernet facility on my motherboard seems to think that its MAC address is: 00:00:00:00:00:00 and in linux I can't get internet!


Response Number 1
Name: Jake (by Jake2)
Date: August 14, 2005 at 19:03:17 Pacific
Subject: change MAC address
Reply:

You need to "ifconfig eth0 down" first, then change the MAC, and "ifconfig eth0 up" to use it.


Response Number 2
Name: dave (by lambousa)
Date: August 14, 2005 at 22:08:24 Pacific
Subject: change MAC address
Reply:

Thanks Jake for the tip. However, after up-ing the eth0 after the MAC switch, I can't seem to get the connection at all....

Anymore advice would be really appreciated,
Dave


Response Number 3
Name: Jake (by Jake2)
Date: August 14, 2005 at 22:56:48 Pacific
Subject: change MAC address
Reply:

Did you reconfigure the IP address after up-ing it? If you use DHCP, you'll probably want to kill and relaunch dhcpcd or possibly dhclient. For static IPs, use ifconfig.


Response Number 4
Name: dave (by lambousa)
Date: August 15, 2005 at 07:14:14 Pacific
Subject: change MAC address
Reply:

You are absolutely right - I did not. Could you tell me what I would type to kill and relaunch the DHCP facility? Sorry to be so high maintenance, but I'm learning linux piece by piece!
Dave


Response Number 5
Name: Jake (by Jake2)
Date: August 15, 2005 at 07:21:11 Pacific
Subject: change MAC address
Reply:

killall dhcpcd
dhcpcd

or if you use dhclient (you can use "ps ax" to list running processes and find out)

killall dhclient
dhclient

Response Number 6
Name: dave (by lambousa)
Date: August 16, 2005 at 05:17:32 Pacific
Subject: change MAC address
Reply:

Thanks Jake - that worked perfectly!
Dave

http://compnetworking.about.com/od/netw ... sing_2.htm

"The MAC address is an important element of computer networking. MAC addresses uniquely identify a computer on the LAN. MAC is an essential component required for network protocols like TCP/IP to function."

http://compnetworking.about.com/od/netw ... 62202a.htm
"It's a slight oversimplification, but one can think of IP addressing as supporting the software implementation and MAC addresses as supporting the hardware implementation of the network stack. The MAC address generally remains fixed and follows the network device, but the IP address changes as the network device moves from one network to another."

http://whoozoo.co.uk/mac-spoof-linux.htm

THIS IS THE LINUX APPLICATION
http://www.alobbs.com/modules.php?op=mo ... file=index
GNU MAC Changer
A GNU/Linux utility for viewing/manipulating the MAC address of network interfaces

Features

* Set specific MAC address of a network interface
* Set the MAC randomly
* Set a MAC of another vendor
* Set another MAC of the same vendor
* Set a MAC of the same kind (eg: wireless card)
* Display a vendor MAC list (today, 6800 items) to choose from


Possible usages
You should use your imagination :-), but well, these are some examples:

(Mic67 comment: if you are being persistently hacked and your IP is dynamic then it is likely from your Mac address ( -of course there is more than just this one reason for being compromised, but it may offer a solution in certain circumstances,) rather then changing your NIC to get a new mac address......)

* You're in a DHCP network with some kind of IP-based restriction
* You've a cluster that boot with BOOTP and you want to have a clean set of MACs
* Debug MAC based routes

Comments anyone?

Post Reply