[Ilugc] ping packet with wrong mac

  • From: binand@xxxxxxxxx (Binand Sethumadhavan)
  • Date: Sat Nov 5 14:57:51 2005

On 5 Nov 2005 04:46:51 -0000, MUNEER CH <muneerch@xxxxxxxxxxxxxx> wrote:

My hardware has the MAC address 00:01:12:03:04:05. I want to change it to 
some other
value(say 00:00:5e:00:01:01) without configuring it to the hardware using the 
ioctl

You cannot change the value on the NIC anyway - it is hardcoded into
the NIC (and hence is also known as a BIA - Burnt-In Address). All you
can do is to make the NIC respond to a different MAC address, on a
per-boot basis - which is done by:

ifconfig eth0 hw ether 00:00:5e:00:01:01

The BIA stays in place. I haven't heard of any technique that lets you
change it. It in fact lets you identify the manufacturer of the
device.

SIOCSHWADDR call(actually I want to configure more than one mac address to a 
single
interface). Hence i should recieve packets to MAC1 and MAC2. Packets to MAC1 
will be
recieved since it is a configured address. But how can I receive MAC2 
packets? I agree
Packets are not switched.

Theoretically, you can do this with some amount of Linux kernel
hacking. But you should understand that what you describe will be
perceived by other devices on the network as an IP address collision -
your NIC will respond for ARP packets asking for its IP with both the
MACs. Most networking hardware will ignore at least one of these
(Cisco switches will shut down the port where the collision is found).
Your box will be unreachable on the network.

Now, if you want to have multiple IP addresses on the same interface,
each with its own MAC, then I guess it can be done with some amount of
fiddling around. I haven't given this much thought, though - but if I
were implementing this, I probably know where to start with.

Binand

Other related posts: