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

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

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,688

    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,688

    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
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE