Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mac mini M1 ethernet doesn't work after waking from sleep

When I wake my Mac mini M1 (Big Sur 11.1) up, the ethernet connection doesn't work.

It appears to be online (shows the previously assigned DHCP address, and has a green dot next to it in the system preferences), but doesn't work.

Tried turning it off and on again - shows an amber dot with 'self assigned IP'.

Wifi works as usual.

Tried pulling the cable out and plug it back in - does not connect.

I tried to connect another device using the same cable, to make sure it's not my ethernet switch or connection that is faulty - works.

Restarting fixes the issue.

Anyway to resolve it? I'd really just want to wake the mini up and continue working...


Posted on Jan 8, 2021 12:51 AM

Reply

Similar questions

67 replies

Mar 7, 2021 7:07 AM in response to geehard

I feel you. This is BS on Apple's side though. They do not even admit that there is a problem when from this thread, at a minimum there seems to be a pattern. I may script it and put it in a cron to run every hour. At least until they fix it. However since I have a support ticket open, I am going to hold out hope until I exhaust there knowledge which at this point, could be very soon.

Mar 10, 2021 1:10 AM in response to Moshe Gottlieb

Like others have mentioned, I've noticed this happening while the computer is running and even while the NIC is active (during a large download), so it seems to have nothing to do with power management.

For now, I've written a small C program to restart the NIC if needed.

It's a C program and not a bash script because it needs to be run as root, and shell script no longer respect the sticky bit for security reasons.

You'd need a C compiler to compile it, the easiest way to install the Xcode command line tools is to just type:

gcc in the terminal.

If you don't have it installed, the system should prompt you to install the command line tools.

Once you have a working C compiler (no system is truly whole without one!), do the following in a terminal:

mkdir -p ~/bin # I'm using ~/bin for my local user binaries, feel free to change
cc keep_nic_alive.c -o keep_nic_alive
sudo chown root keep_nic_alive # Make it owned by root
sudo chmod +s keep_nic_alive # Apply the sticky bit, so it would run as root as the euid
sudo mv keep_nic_alive ~/bin/ # Move it to my bin directory

Edit your crontab file:

crontab -e

and add:

* * * * * ~/bin/keep_nic_alive 192.168.0.1 >> ~/keep_nic_alive.log

!!!Change the address to your router's address!!!

The file keep_nic_alive.log in your home directory will log restart attempts.

And finally - here's the code for keep_nic_alive.c:


//
//  keep_nic_alive.c
//  keep_nic_alive
//  Simple program that either receives the current router address or tries to figure it out by itself, ping it and restart en0 if needed.
//  See https://discussions.apple.com/thread/252283789 for more info.
//  Created by Moshe Gottlieb on 10-Mar-21.
//

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

// Ugly hack!
static char buffer[4096];

/**
 Calls a system command, and sets the output to the static buffer variable
 Yep, nothing you'd see in a real program.
 @param cmd The command to execute
 @return Command status code
 */
int _system(const char* cmd){
    FILE* f = popen(cmd, "r");
    if (!f){
        perror("Could not execute shell command");
        exit(1);
    }
    size_t len = fread(buffer,1,sizeof(buffer)-1,f);
    if (len && buffer[len-1] == '\n') --len; // trim the last \n that is added for some reason
    buffer[len] = '\0'; // Null terminate
    return pclose(f); // status code is returned from pclose
}

int main(int argc, const char * argv[]) {
    if (geteuid() != 0){
        fprintf(stderr,"This program is meant to be run as root\n");
        return 1;
    }
    char router_address[16]; // ipv4 address + dots is 15 characters max
    router_address[15] = 0;
    if (argc == 2){
        strncpy(router_address,argv[1],sizeof(router_address)-1);
    } else {
        _system("/usr/sbin/netstat -r -n | grep default | /usr/bin/head -n1 | tr -s \" \" | /usr/bin/cut -f2 -d \" \"");
        strncpy(router_address,buffer,sizeof(router_address)-1);
    }
    char cmd[512];
    snprintf(cmd, sizeof(cmd), "/sbin/ping -t1 -c1 %s",router_address);
    cmd[sizeof(cmd)-1] = 0; // just in case
    if (_system(cmd) != 0){ // Houston, we have a problem
        printf("Restarting interface en0\n");
        setruid(0);
        system("/sbin/ifconfig en0 down");
        return system("/sbin/ifconfig en0 up");
    } else {
        return 0;
    }
}

Mar 15, 2021 7:27 AM in response to rseidens

@rseidens

I wasn't very hopeful, but I tried changing to a static IP, doesn't help.

@hcsitas

Read the previous messages.

It turns out that this issue occurs not only while the computer is waking up, but also during normal operation.

I've witnessed it as well since I opened this thread and started monitoring the issue.

This is regardless of the fact that disabling an operating system feature is not an acceptable solution, even if in your opinion it is.

Apr 10, 2021 11:32 AM in response to konjelly

I may have identified what causes this, I had Norton 360 running, removed it and the problem went away. I reinstalled it to test and the problem came back. A google on Norton suggested that the Norton firewall may be causing the problem. So I reinstalled Norton 360 and followed the Norton article, unfortunately the article didn’t fix it so I had to remove it again.

I say I may have identified the issue with caution because I originally set up my new Mac from a backup. I was preparing to send it back so reset to factory settings and reinstalled BigSur.

I gave it one last chance and signed in, no problems. So I reinstalled my apps and when I reinstalled Norton 360 the problem started again.

All I can say is that with Norton 360 network connections are dropped and I have to restart frequently. Without Norton 360 the Mac mini M1 with Big Sur fully patched up works trouble free. Not sure if this help, I know how frustrating it was - I very nearly returned the Mac Mini. I’m actually loving it now but this issue made it unusable. I can now drag and drop any file from the network to any other location without an issue. I’ve not raised with Norton yet but will - I’d prefer to have that extra layer of protection.

Apr 22, 2021 6:20 AM in response to Moshe Gottlieb

After reading through all these replies, I think my problem is related enough that it belongs here. Basically, on my M1 Mac Mini (OS 11.2.3) I have it scheduled to wake every day at 8AM. No auto-login, just to boot up so if I'm not in the office I can connect remotely. However, after logging in the ethernet connection doesn't work. Same with the DHCP address and green dot, just no internet connection. Fixes itself after reboot.


So (as many others have said) I don't think disabling sleep is going to fix this issue.

Apr 29, 2021 10:44 PM in response to eamonn146

Thank you! eamonn146. I just got my M1 Mac mini today. My internet was not working neither with ethernet cable nor wifi. My old Mac mini (2018) was working perfectly well with wifi next to it. I deleted the Norton Security app and restarted but still no internet. Then I noticed in the Network preference, under ethernet, Norton Security which I don't remember ever seeing it in my previous Mac mini Network preference. It had the green dot. I deleted clicking on the minus sign below, restarted the computer and bingo! I hope it will be a stable solution.

Jul 23, 2021 6:59 AM in response to Moshe Gottlieb

Awesome, my second issue with the new M1 Mini. Before anyone asks: it’s the latest OS, I’ve tried unplugging the cable, plugging it back in, created a new Ethernet service, shutdown, powered on, rebooted, etc. and it just appears the Ethernet stack on my machine is broken. Of course looking at in in preferences it’s all green, but I cannot download shows or browse websites. I didn’t have sleep disabled before and basically it didn’t wake properly - machine kept rebooting over and over again finally going into recovery mode - why? Who knows. I ran disk utility repair, which repaired nothing and rebooted. A message appeared about 3rd party drivers being disabled, but I never had any third party drivers so I don’t know what that’s about. Honestly had I known what was in store I’d have replaced my 2014 Mini with the newer intel one rather than this, though when it has working internet it’s very fast. I’ve switched off sleep in energy saver, but given nothing I do will get my ethernet link working again, I guess there’s no point to having done that 🤷‍♂️


I cannot understand how they’ve released hardware with this serious an issue. Fingers crossed another update is coming soon, because until then I guess I’m using WiFi.

Jul 23, 2021 5:54 PM in response to Sean Aaron

@Sean Aaron Ethernet hardware definitely seems flaky. I had disabled the screen saver and the sleep settings before I experienced the same reboot -> crash -> reboot loop as you. Luckily for me the system eventually righted itself. I don't know what I did that made any difference. The ethernet interface still drops at random times, requiring a ifconfig down then up to bring it back but so far it always comes back. My 10 year old Mac mini is more reliable than my new M1 mini. :-(

Jul 23, 2021 7:25 PM in response to Kyle Jones3

On a side note that may be related. I was having issues with intermittent Wi-Fi and Bluetooth. The signal meter always showed at least 2 of 3 bars and sometimes would stop working when 3 bars were showing.


I found the issue was the USB3 7-port HUB I added was acting like an antenna and interfering with the Wi-Fi and BT. Maybe USB devices RF noise effect the wired Ethernet as well?


I fixed the issue by adding RF shielding to my HUB's cable and case with copper tape and ferrite beads. Since the ferrite bead kit came with several of many sizes I also added them to all my USB cables that didn't already have them. Knock on wood... So far the issue hasn't returned after several days.


I also disabled sleep since restart of network from sleep is broken on the M1 mac.


Jul 29, 2021 5:13 AM in response to Moshe Gottlieb

Same here. It is not related to "prevent computer from sleeping" feature (I have disabled this feature and the problem persists). For me, it occurs randomly even after macos 11.5.1 update. Yesterday during a zoom videocall, it occurred multiple times (I had to use wifi instead)

The only workaround so far:

sudo ifconfig en0 down 

sudo ifconfig en0 up


In this thread, someone proposed to execute a script written in C to automatically restart the interface with the aforementioned commands. However, it is far from being a solution for everyday users.


I do not have any security software installed such as Norton

Aug 1, 2021 3:12 AM in response to Moshe Gottlieb

Update: I tweeted at Apple Support and they suggested stuff I had tried: swapping cables, ports, manual IP - none of which changed anything - still showing connected on router and network prefs, but no internet connection. Ran diagnostic mode - no errors found, though I had to disconnect the ether or it hung at “verifying network connection” even with WiFi enabled. Finally they asked me to reset my router, which solved the problem, but I note that I had three other devices connected with ether and six on WiFi NONE of which had a problem, so it seems to me the M1 might have some kind of firmware issue or the M1 build of macOS has a driver issue still (upgraded to 11.5.1 during all this which changed nothing) with handshaking.


It’s bizarre. How can the machine think the link is connected, when it clearly isn’t (only got “you’re not connected to the internet” when I pulled the cable)?


Now if I can get FaceTime audio to work with HDMI that will be something…

Mac mini M1 ethernet doesn't work after waking from sleep

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.