Clone MAC address in Linux

In almost all DSL/Cable Routers (Barricades and Linksys) they give you the option of cloning the mac address of a machine on the network or allowing you to manual enter a new mac address for the WAN port.

Is this possible in Linux?  I have a Linux Box with two NICs, Eth0=WAN Eth1=LAN.  I want to set Eth0's MAC address to that of a machine on my network.

Please inform me how this would be done!

Thanks
LVL 1
jajejAsked:
Who is Participating?
 
John_Bell_2Connect With a Mentor Commented:
Whups - the ipconfig command is MS, not Linux. I believe ahoffman meant "ifconfig". Look at the man page for ifconfig ("man ifconfig") and scroll down to the description for "hw class address". In your case, you're making the change on an ethernet interface. If the device driver for your ethernet interface supports changing the MAC (as ahoffman has mentioned), then you can run the following command to make the change:

root# ifconfig eth0 hw ether 00:01:02:03:04:05 (example)

That should do the trick. Let me know how it turns out.
0
 
ahoffmannCommented:
this can simply done with the ipconfig command
But your NIC must support setting of the MAC.
0
 
ahoffmannCommented:
oops, ifconfig

> If the device driver for your ethernet interface ..
hmm, to be more precise: this must be the driver on the NIC itself, usually in a ROM or a-like.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
John_Bell_2Commented:
Right, the NIC has to support it. Ugh, layering...
0
 
jajejAuthor Commented:
Do 3Com and Intel cards support "temporary" changing of the MAC address using ifconfig?  I don't want to change the MAC address permanently.
0
 
jajejAuthor Commented:
Do 3Com and Intel cards support "temporary" changing of the MAC address using ifconfig?  I don't want to change the MAC address permanently.
0
 
ahoffmannCommented:
most 3Com do, but check your docs
0
 
jajejAuthor Commented:
FOR EVERYONE: Just so you guys know, at least with 3Com 3C905c and RH 7.2 this is the order to change the MAC address of the card.

1. ifconfig eth(x) down
2. ifconfig eth(x) hw ether 00:01:02:03:04:05
3. ifconfig eth(x) up

I will award the points in a day so that people have some time to weigh in if they would like.


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.