netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Reset hardware address (MAC address) in c++
@ 2011-01-09 14:39 Chin Shi Hong
  2011-01-09 16:06 ` Ben Hutchings
  0 siblings, 1 reply; 2+ messages in thread
From: Chin Shi Hong @ 2011-01-09 14:39 UTC (permalink / raw)
  To: netdev

Dear All,

My final year project is all about MAC address spoofing.

I do know that I can reset the MAC address of my network adapter to
its original by rebooting the Linux operating system I am using.

My Linux distribution is using NetworkManager. On Wireless network,
each time after I change the MAC address of my wireless network
adapter and then connect to the wireless network, and then once I
disconnect from wireless network, NetworkManager will reset the MAC
address of my wireless network adapter to its original.

I had programmed my application to change the MAC address. Now, trying
to implement the feature that reset the MAC address. I don't know
whether NetworkManager record down the original MAC address of my
Network Adapter or not. But, assume if NetworkManager is able to reset
the MAC address of my network adapter to its original MAC address
without recording the original MAC address and without reboot, then my
application must be able to do the same.

So, can anyone tell me the C++ codes that is able to reset the MAC
address, or give me some ideas on this, please?

Regards,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Reset hardware address (MAC address) in c++
  2011-01-09 14:39 Reset hardware address (MAC address) in c++ Chin Shi Hong
@ 2011-01-09 16:06 ` Ben Hutchings
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Hutchings @ 2011-01-09 16:06 UTC (permalink / raw)
  To: Chin Shi Hong; +Cc: netdev

On Sun, 2011-01-09 at 22:39 +0800, Chin Shi Hong wrote:
> Dear All,
> 
> My final year project is all about MAC address spoofing.
> 
> I do know that I can reset the MAC address of my network adapter to
> its original by rebooting the Linux operating system I am using.
> 
> My Linux distribution is using NetworkManager. On Wireless network,
> each time after I change the MAC address of my wireless network
> adapter and then connect to the wireless network, and then once I
> disconnect from wireless network, NetworkManager will reset the MAC
> address of my wireless network adapter to its original.
> 
> I had programmed my application to change the MAC address. Now, trying
> to implement the feature that reset the MAC address. I don't know
> whether NetworkManager record down the original MAC address of my
> Network Adapter or not. But, assume if NetworkManager is able to reset
> the MAC address of my network adapter to its original MAC address
> without recording the original MAC address and without reboot, then my
> application must be able to do the same.
> 
> So, can anyone tell me the C++ codes that is able to reset the MAC
> address, or give me some ideas on this, please?

You can read the permanent MAC address using the ethtool
ETHTOOL_GPERMADDR operation.  See the ethtool utility for an example of
how to use this.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-09 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-09 14:39 Reset hardware address (MAC address) in c++ Chin Shi Hong
2011-01-09 16:06 ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).