Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Modifying physical NIC card MAC address

sathish1323sathish1323 Member Posts: 7

I have written a load balancing driver using the NDIS intermediate driver. I am using two NIC cards to provide failover and a virtual miniport is created. Transmission and reception is happening properly. The concern now is both the physical network adapters should be set with the same MAC address.

Can anyone suggest me the right way of doing this from the intermediate driver. MSDN documentation says that "The network management software cannot set the current station address using the NDIS interface library. It must set this address as a configuration parameter." for setting the "OID_802_3_CURRENT_ADDRESS". I am bit confused about setting this parameter as configuration parameter. Can anybody help me in this?

Comments

  • Phil_SikoraPhil_Sikora Member Posts: 58

    Setting duplicate MAC adresses would not be recommended, it violates the data link layer requirements, see
    https://en.wikipedia.org/wiki/MAC_address

  • Pavel_APavel_A Member Posts: 2,708

    Usually the lowest level netcard drivers can override the physical MAC address. This can be done with a common registry parameter. After initialization there's no documented way to ask a miniport to change the MAC address. That's a miniport will fail attempt to set OID_802_3_CURRENT_ADDRESS.

    -- pa

  • sathish1323sathish1323 Member Posts: 7

    @Phil_Sikora said:
    Setting duplicate MAC adresses would not be recommended, it violates the data link layer requirements, see
    https://en.wikipedia.org/wiki/MAC_address

    I will assign the same mac address to both the network cards present in my system. But these two network cards are connected to two different networks. Two networks are entirely separated out from each other and there is no way for a node in one network to communicate to a node in other network. This is to provide redundancy and PRP(Parallel redundancy protocol) is designed in this way.

  • sathish1323sathish1323 Member Posts: 7

    @Pavel_A said:
    Usually the lowest level netcard drivers can override the physical MAC address. This can be done with a common registry parameter. After initialization there's no documented way to ask a miniport to change the MAC address. That's a miniport will fail attempt to set OID_802_3_CURRENT_ADDRESS.

    -- pa

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4d36e972-e325-11ce-bfc1-08002be10318}*****
    I found there is an entry "NetworkAddress" under the adapter key in the above mentioned hierarchy which miniport uses to allow upper layer to set a custom MAC address and the modified mac address can be restored by reading the "OriginalMACAddress" entry present in the adapter's registry key.
    Set the mac address in the registry and restarting the network adapter resolves the problem.

  • Pavel_APavel_A Member Posts: 2,708

    I found there is an entry "NetworkAddress"

    Yes, this. You can assign locally administered (fake) addresses to avoid breaking rules.
    How will Windows handle two miniport instances with same MAC address - I don't know, just try to do this.
    It looks that you don't own the miniport, so you cannot play tricks with the MAC address, such as set same addresses in the hardware but report different addresses to the system.

    -- pa

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA