You are not logged in.

#1 2008-01-01 10:27:04

qs
Member
Registered: 2008-01-01
Posts: 3

How to modify MAC address?

Hi,if I want to modify my MAC address at boot time by default,how can I do?
I get my IP address by DHCP,and the IP address is banded to the MAC address.
Thank you!

Offline

#2 2008-01-01 10:43:48

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: How to modify MAC address?

Add this to one of the startup scripts, it only has to be executed before you start networking. (I'm not sure about the execution order, I'm sorry.)

ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

Offline

#3 2008-01-01 10:54:51

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to modify MAC address?


Give what you have. To someone, it may be better than you dare to think.

Offline

#4 2008-01-01 11:00:07

qs
Member
Registered: 2008-01-01
Posts: 3

Re: How to modify MAC address?

wuischke wrote:

Add this to one of the startup scripts, it only has to be executed before you start networking. (I'm not sure about the execution order, I'm sorry.)

ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

Thank you!
I ever add this to /etc/rc.local,it works,but I still can't get IP address.
If I run "/etc/rc.d/network restart",I can get my IP address,as a result of this,my OS get slowly,why?

Offline

#5 2008-01-01 11:04:13

qs
Member
Registered: 2008-01-01
Posts: 3

Re: How to modify MAC address?

Thank you!
I have a try

Offline

#6 2008-01-01 15:46:52

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to modify MAC address?

qs wrote:

Thank you!
I ever add this to /etc/rc.local,it works,but I still can't get IP address.
If I run "/etc/rc.d/network restart",I can get my IP address,as a result of this,my OS get slowly,why?

isn't slowly. to change your mac adress you need to changed it before eth0 is going up(i don't know why you don't see an error SIOCSIFHWADDR: Device or resource busy ). if you prefer that solution you need to add:

ifconfig eth0 down
ifconfig eth0 hw ether bla:bla:....
ifconfig eth0 up

but i prefer the first solution that i showed you.


Give what you have. To someone, it may be better than you dare to think.

Offline

#7 2008-01-01 16:51:47

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: How to modify MAC address?

at boot rc.local runs at the end of the boot process, thus rc.d/network is run before. that's why you have to rerun rc.d/network.

Last edited by lloeki (2008-01-01 16:52:16)


To know recursion, you must first know recursion.

Offline

Board footer

Powered by FluxBB