You are not logged in.

#1 2005-08-30 12:06:46

fluke
Member
From: Shaoguan Univ., PRC
Registered: 2005-08-12
Posts: 241
Website

how to modify my HWaddr

I use this command:

ifconfig eth0 192.168.132.2 hw ether 00:FF:FF:DC:EF:FD

but it said device busy.

And, how can I modify my HWaddr permanently?

Offline

#2 2005-08-30 14:20:53

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: how to modify my HWaddr

Hmm.. You should set the hardware address with

ifconfig eth0 hw ether 00:FF:FF:DC:EF:FD

before you bring the interface up. Not all network cards support this operation, though.

If you can set the hardware address manually and have a static IP address, a permanent solution might be to edit the line in /etc/rc.conf that starts with eth0=... to something like this:

eth0="192.168.132.2 hw ether 00:FF:FF:DC:EF:FD netmask 255.255.255.0 broadcast 192.168.0.255"

With a dynamic IP address I don't see a way to do it without tweaking /etc/rc.d/network...

A natural question in this context is: why would you want to forge your hardware address?  smile

Offline

#3 2005-08-30 21:35:04

colnago
Member
From: Victoria, BC
Registered: 2004-03-25
Posts: 438

Re: how to modify my HWaddr

The /etc/conf.d/dhcpcd parameters get passed to the daemon when you use dhcp.  For example, you can specify a '-R' there if you don't want /etc/resolv.conf to be overwritten.  I presume you could put 'ether 00:FF:FF:DC:EF:FD'  on that line too.

Spoofing mac addresses is sometimes needed for aDSL connections, as the telco often only accepts the mac used to activate the service.  You can phone in and get it changed if you have the time.

Also, sometimes the hardware has an invalid mac address and it neets to be over ridden.

I was just looking and it seems dhcpcd wont let you do it.  Maybe you could set up a script to run ifconfig and put it before the network one in rc.conf?

Offline

#4 2005-08-31 12:54:53

fluke
Member
From: Shaoguan Univ., PRC
Registered: 2005-08-12
Posts: 241
Website

Re: how to modify my HWaddr

sh__ wrote:

Hmm.. You should set the hardware address with

ifconfig eth0 hw ether 00:FF:FF:DC:EF:FD

before you bring the interface up. Not all network cards support this operation, though.

If you can set the hardware address manually and have a static IP address, a permanent solution might be to edit the line in /etc/rc.conf that starts with eth0=... to something like this:

eth0="192.168.132.2 hw ether 00:FF:FF:DC:EF:FD netmask 255.255.255.0 broadcast 192.168.0.255"

With a dynamic IP address I don't see a way to do it without tweaking /etc/rc.d/network...

A natural question in this context is: why would you want to forge your hardware address?  smile

I tried you ways, but seems not work
the hw did not change.

A natural question in this context is: why would you want to forge your hardware address?  smile

just for study. smile

Offline

Board footer

Powered by FluxBB