Jump to content

Realtek RTL8168/8111 optimized driver with MAC address customization


Andy Vandijck
 Share

38 posts in this topic

Recommended Posts

I improved the driver originally made by Mieze.

I added a setting in the Info.plist making it possible to change the MAC address of the card.

It really works great and fast.

I also optimized it to build as kext module with module support.

Enjoy :D

Source is included, tested under Yosemite.

 

EDIT: New version.

I added a userclient with a preference pane.

Now it is possible to change the MAC address on-the-fly using the settings pane.

 

EDIT2: I added a Github page.

https://github.com/andyvand/RTL8111

RTL8111_driver_for_OS_X.zip

  • Like 16
Link to comment
Share on other sites

 

Thank you Andy for the really great work.
 
Please explain it out exactly where in which string I can change the MAC address.
 
where in the info.plist ?
 
Thank You

 

In the Info.plist mod the IOMACAddress key.

Change it to any MAC address you want ;)

By default it has an Apple MAC Address set.

Link to comment
Share on other sites

 

Thank you Andy for the really great work.
 
Please explain it out exactly where in which string I can change the MAC address.
 
where in the info.plist ?
 
Thank You

 

If one's not too lazy to search for a sec it's just some clicks. ^_^

 

IOKitPersonalities ➜ D-Link GigaFast... ➜ IOMACAddress

 

IOKitPersonalities ➜ Realtek RTL81111... ➜ IOMACAddress

  • Like 1
Link to comment
Share on other sites

@Andy please

You write this:

 

Change it to any MAC address you want

 

What do you mean with "Any Mac Address"? Should I put the Mac Address of my Eyhernet?

 

Or you mean I can put a Mac Address in the Apple range. In this case, I'm using one that I'm injecting in Clover. Can I use this one?

 

Can you explain what is the reason to inject another Mac Address, different from the original one of the ethernet?

 

Carmine

Link to comment
Share on other sites

@Andy please

You write this:

Change it to any MAC address you want

What do you mean with "Any Mac Address"? Should I put the Mac Address of my Eyhernet?

 

Or you mean I can put a Mac Address in the Apple range. In this case, I'm using one that I'm injecting in Clover. Can I use this one?

 

Can you explain what is the reason to inject another Mac Address, different from the original one of the ethernet?

 

Carmine

Yes you can use that MAC address in the Apple range.

This is the reason I created it.

The new version can even afterwards change the MAC address using a prefpane. ;)

  • Like 2
Link to comment
Share on other sites

Yes you can use that MAC address in the Apple range.

This is the reason I created it.

The new version can even afterwards change the MAC address using a prefpane. ;)

@Andy

Can you be more specific about the usefulness of putting an Apple Mac Address. Perhaps is for iMessage and FaceTime issue?

Thanks in advance

  • Like 2
Link to comment
Share on other sites

@Andy

Can you be more specific about the usefulness of putting an Apple Mac Address. Perhaps is for iMessage and FaceTime issue?

Thanks in advance

Exactly.

To change it so Facetime and iMessage can work.

Look up info on MLB and ROM on how this works.

so now use this kext and prefPane?

attachicon.gifSchermata 2015-12-29 alle 19.49.34.png

Permanent MAC addres -> Info.plist

prefpane is for during testing fase -> for example when you are working on getting iMessage working.

  • Like 1
Link to comment
Share on other sites

Andy, you mind doing this for Qualcomm Atheros AR816x, AR817x and Killer E220x, would like to test this out

Yes but not for free.

I'm currently in urgent need for money so I could use all the donations I can get.

There is a Paypal account linked to my e-mail address: andyvand@gmail.com

  • Like 4
Link to comment
Share on other sites

Unfortunately, I can not understand how to function alone the new MAC address for iMessage, because you need but a matching !! MLB number to it.

For it is known that ONLY a couple with ROM and MLB from the original Mac's work with iMessage.

 

Suppose I create a new MAC address just happen with the RTL8111.prefPane, I then but no MLB number for this. So could the notice of the

registration server of Apple and therefore does not allow this MAC address.

 

Should I go wrong with this assumption, then please write exactly how it would work and where do I get to the generated

MAC addresses matching the MLB number come from?

Link to comment
Share on other sites

 

Unfortunately, I can not understand how to function alone the new MAC address for iMessage, because you need but a matching !! MLB number to it.
For it is known that ONLY a couple with ROM and MLB from the original Mac's work with iMessage.
 
Suppose I create a new MAC address just happen with the RTL8111.prefPane, I then but no MLB number for this. So could the notice of the
registration server of Apple and therefore does not allow this MAC address.
 
Should I go wrong with this assumption, then please write exactly how it would work and where do I get to the generated
MAC addresses matching the MLB number come from?

 

Use a real MLB, ROM, etc...

Then change MAC address in the Info.plist to match this ROM value.

Problem solved...

Link to comment
Share on other sites

 

Do you change here or where? in RealtekRTL8111.kext - Show Package Contents, and then click Content in info.plist

 

<string>RTL8111</string>

<key>IOMACAddress</key>

<data>

fH34KJ4j

</data>

 

I do not understand the correct MAC address of en0 I see in Sytemprofil is much longer and another as here.

Link to comment
Share on other sites

 

 
Do you change here or where? in RealtekRTL8111.kext - Show Package Contents, and then click Content in info.plist
 
<string>RTL8111</string>
<key>IOMACAddress</key>
<data>
fH34KJ4j
</data>
 
I do not understand the correct MAC address of en0 I see in Sytemprofil is much longer and another as here.

 

Use Xcode / PlistEdit Pro for editing.

The type is data so that mean base64 encoded.

Link to comment
Share on other sites

Thank you my friend AnV for the tip

 

Well, then you can use a MAC address here so that would be because, for example, Apple usual?

this can be a fictional or real from a genuine Apple Mac's?

 


addendum:

 

I just occasionally found a post that could so use a random MAC address for function of iMessage, for example?


 

or this here:


post-6397-0-74369400-1420071257_thumb.png

Link to comment
Share on other sites

I improved the driver originally made by Mieze.

I added a setting in the Info.plist making it possible to change the MAC address of the card.

It really works great and fast.

I also optimized it to build as kext module with module support.

Enjoy :D

Source is included, tested under Yosemite.

 

EDIT: New version.

I added a userclient with a preference pane.

Now it is possible to change the MAC address on-the-fly using the settings pane.

 

EDIT2: I added a Github page.

https://github.com/andyvand/RTL8111

could i ask you make this kext better as well http://www.insanelymac.com/forum/index.php?app=core&module=attach&section=attach&attach_id=143761 it needs much improving 

Link to comment
Share on other sites

could i ask you make this kext better as well http://www.insanelymac.com/forum/index.php?app=core&module=attach&section=attach&attach_id=143761 it needs much improving 

Same condition,

Paypal... then I'll make one for ALXEthernet too...

This one is free, others are at a premium :D

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Thank you - this new driver/kext is working great on my H61N-USB3 box(es) running Yosemite. 

 

Realtek RTL8168E-VL/8111E-VL PCI Express Gigabit Ethernet:

 

  Name: ethernet

  Type: Ethernet

  Bus: PCI

  Slot: Ethernet

  Vendor ID: 0x10ec

  Device ID: 0x8168

  Subsystem Vendor ID: 0x1458

  Subsystem ID: 0xe000

  Revision ID: 0x0006

  Link Width: x1

  BSD name: en0

  Kext name: RealtekRTL8111.kext

  Location: /System/Library/Extensions/RealtekRTL8111.kext

  Version: 1.3.5

 

 

$ grep kernel /var/log/system.log|grep -i real

Jan 10 19:35:37 localhost kernel[0]: Ethernet [RealtekRTL8111]: EEE support enabled.

Jan 10 19:35:37 localhost kernel[0]: Ethernet [RealtekRTL8111]: TCP/IPv4 segmentation offload enabled.

Jan 10 19:35:37 localhost kernel[0]: Ethernet [RealtekRTL8111]: TCP/IPv6 segmentation offload enabled.

Jan 10 19:35:37 localhost kernel[0]: Ethernet [RealtekRTL8111]: TCP/IPv6 checksum offload enabled.

Jan 10 19:35:37 localhost kernel[0]: Ethernet [RealtekRTL8111]: Initialized emulated MAC address = 7C:6D:F8:AC:9E:1F

Jan 10 19:35:37 localhost kernel[0]: Ethernet [RealtekRTL8111]: Version 1.3.5 using interrupt mitigate value 0xcf58.

Jan 10 19:35:37 localhost kernel[0]: Initialized real MAC Address: 7C:6D:F8:AC:9E:1F

Jan 10 19:35:37 localhost kernel[0]: Ethernet [RealtekRTL8111]: detected RTL8168E-VL/8111E-VL (Chipset 16) at 0xffffff8107c2e000

Jan 10 19:35:56 Toms-Hack kernel[0]: Ethernet [RealtekRTL8111]: Link up on en0, 100-Megabit, Full-duplex, flow-control

Link to comment
Share on other sites

Same condition,

Paypal... then I'll make one for ALXEthernet too...

This one is free, others are at a premium :D

This driver is absolutely horrible, especially in Yosemite. If you can make it work properly - i'll be happy to donate! :)

  • Like 3
Link to comment
Share on other sites

Yes but not for free.

I'm currently in urgent need for money so I could use all the donations I can get.

There is a Paypal account linked to my e-mail address: andyvand@gmail.com

 

Don't you think that this is impudent? Taking the result of someone else's hard work and ask for money in order to add a few lines of trivial code?

 

By the way, do you have any idea what you are doing? These lines of code suggest that you don't:

IOReturn RTL8111Client::actionMethodSetMAC(UInt32 *dataIn, UInt32 *dataOut, IOByteCount inputSize,
                                             IOByteCount *outputSize)
{
    inout * macdata = (inout *)dataIn;
    IOEthernetAddress MACAddr;

    DebugLog("RTL8111Client: Set MAC address called\n");
    
    if (!dataIn)
    {
        return kIOReturnUnsupported;
    }

    bcopy(macdata->macaddr, MACAddr.bytes, sizeof(MACAddr.bytes));

    mDevice->setPromiscuousMode(true);
    mDevice->setHardwareAddress(&MACAddr);
    mDevice->SetIsCustomMACAddr(true);

    return kIOReturnSuccess;
}

Have you ever thought about the side effects of your "improvements"?

 

Mieze

  • Like 3
Link to comment
Share on other sites

This driver is absolutely horrible, especially in Yosemite. If you can make it work properly - i'll be happy to donate! :)

Sure, I don't have have any time to do it today but tomorrow I'll start on implementing a better one (based on latest sources available) when I have the time (have also a lot to do tomorrow).

If you really make it worth my while I'll continue to support this driver then (and update when I can).

I'll let you know a.s.a.p. ;)

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...