Recent Apple updates leading to WiFi issues?
meter.com
meter.com
People would assume there is a serious problem, turn off a bunch of services, run a bunch of random-ass shell scripts, and then forget that they'd done all that and at some random point in the future discover that some feature wasn't working, and blame me.
So that you could both discover, in cases like this, what's changed -- but also simply so you could export your settings in a space-efficient way and (selectively) re-import on a new OS install.
For example, a typical Windows deployment is 15-20GB after being extracted from an ISO image that's essentially static. There's monthly updates, which are also monolithic multi-GB patches that wholesale replace system files.
This is basically like a Docker image, but with the Kernel and drivers included in the base layer...
.. but without any of the niceties of dockerfiles, such as precisely tracking what differences have been applied!
The Windows registry could be split into a "system base hive", a "patch hive", and then a "customisations hive" on top.
Similarly, Linux filesystems could keep a base copy of the "/etc" directory and then any changes on top in something like a unionfs or docker image like overlayfs.
Modern phone operating systems more-or-less work like this, so it's definitely possible.
In the distant past of 40MB hard drives, this approach would have been wasteful. In the era of 5GB patches... does it really matter?
9.0G Oct 27 06:54 win2016_core.qcow2
12G Oct 27 06:30 win2016.qcow2
7.4G Oct 27 06:31 win2019_core.qcow2
12G Oct 27 07:02 win2019.qcow2
6.9G Oct 27 07:03 win2022_core.qcow2
11G Oct 27 06:56 win2022.qcow2Once it actually is usable, sure, I'll take a look.
# backup defaults to a file in the home directory with the current timestamp
alias backup.defaults='defaults read > ~/.backups/defaults_$(date +%Y%m%d-%H%M%S).txt'
# compare the most recent defaults backup file to the current defaults config
alias diff.defaults='diff -u <(cat ~/.backups/$(ls -1 ~/.backups | grep defaults | tail -1)) <(defaults read) | delta' $ mpm --output-format json installed > installed.json
Source: https://github.com/kdeldycke/meta-package-manager/With regular snapshots you can at least eliminate new installed software as the root cause of an issue. Doesn't solve the issue with preferences though.
Although, for the major changes I feel the major OS's should add the ".diff" file called updates.diff and describe the major updates in your laptop.
This should also happen each update, we need to know what updates are going to be installed, and what is the purpose of doing this?
(The main or second main thing now would be window management, the period I was using both made me like i3 now sway more and more, and grow to find macOS even with yabai or similar much more difficult and messy to use.)
It took us 5 days to figure it out. We had no less than a dozen professionals on it. Each with at least a decade of experience. We combed the Wi-Fi and network config repeatedly to figure out what we did wrong. (It wasn’t till we had the hint that it was client side that we sniffed the nic to see the packet of death)
So I’m going to respectfully disagree. Articles like this are important. If I’d seen this last Monday it’d have saved me a week of hell and saved my client a week of vastly diminished productivity. Not to mention the tens of thousands of dollars spent diagnosing it and the millions of dollars of lost revenue from the deals they couldn’t close because calls kept dropping in the office (because enough people were on hotspots to saturate cell service in the area)
That's important for the reasons the person you're responding to mentioned. I too have seen many problems caused by this kind of thing where someone had something they didn't like, made a ton of low-level config changes based on random blog posts, and then forgot about that when it broke something else.
We’ve seen this repeatedly across different types of spaces and have had teams spend similar amounts of time to get to know what’s going on underneath.
It does happen to older models as well with an updated MacOS but not as acutely as with M1/M2 Macs.
That script will be hanging around on people's laptops for years, if not decades (for people that migrate their macOS installations to new machines) at the end of the long tail.
For companies that decide to implement this or a similar solution using MDM, `sudo pkill -f /tmp/disable_awdl.sh && sudo ifconfig awdl0 up` will also disable the effects of the script.
Reconfigured everything I could. Nothing helped.
I ran a packet loss test online. Link below.
It was showing huge delays in packets.
I came across an article somewhere. Forget where now. Disabling the awdl0 interface fixed the issue entirely for me. Packet loss tests worked perfect every time.
Turn the interface back on? Problem reappeared immediately.
That said, I manually turn it on and off as needed and don’t set things up to disable all the time. But it’s a real issue that was causing me a great deal of problem at work. So it’s not just some bug to me. It’s a serious one and you seem to be saying it’s not and people turning it off and forgetting is a big deal. I suppose it could be but don’t reject that it does fix a real issue.
It was an endless discussion about how restarting things can have second order effects, including impacting the equipment that really was the cause.
Unfortunately, there's a very thin line between making it work and making it break.
People in the know are aware that this is just the tip of the iceberg with macOS bugs. Wifi bugs that everyone has to work around, APIs that promise Unicode NFC but aren't actually NFC, quadratic performance bugs caused by various always-on Apple services that trigger under mysterious circumstances, regressions every other minor version, the list goes on. Linux, which has orders of magnitude less money behind it, is somehow so much more robust.
But Apple won at capitalism, and the dream of most startup founders is to also win at capitalism, so this forum is filled with sycophants.
customers would just not know what configuration they had made. so we had a bit of VBScript that would dump the entire config into a text file. amazing how many customers had left themselves open in bad ways in production systems and also how their perspectives of what was configured did or did not match reality.
while true; do
if ifconfig awdl0 |grep -q "<UP"; then
(set -x; ifconfig awdl0 down)
fi
sleep 1
done
That just checks the awld0 interface every second and turns it off if it's on. Apple really doesn't offer any other way to disable awdl?Note that setting AirDrop to "No One" doesn't fully disable awdl. It's used for other things like screen sharing, AirPlay, bonjour device/service discovery, etc. Though perhaps disabling AirPlay is enough to stop the WiFi issues. You can sniff awdl traffic with `sudo tcpdump -i awdl0`
It makes shared clipboard not work as well with my iPhone, but at least I get 180Mbps/70ms on the work VPN instead of 4mbps/70-700ms.
The interface stays down till the laptop sleeps, so most of the time it's a no-op.
sudo /usr/libexec/airportd en0 prefs AWDLEnabled=YES
(Edit: see varenc's reply below)Or you could create a kext (using deprecated KPIs) that continuously blocks the interface from coming up:
errno_t awdlblock_ioctl_handler(void *cookie, ifnet_t interface, protocol_family_t protocol, unsigned long ioctl_cmd, void *ioctl_arg) {
if (SIOCSIFFLAGS == ioctl_cmd) {
struct ifreq *ifr = (struct ifreq*)ioctl_arg;
if (ifr && ((ifr->ifr_flags) & IFF_UP) != 0) {
return EJUSTRETURN;
}
}
return ENOTSUP;
}
kern_return_t awdlblock_start(kmod_info_t * ki, void *d)
{
struct iff_filter filter = { 0 };
errno_t err = ifnet_find_by_name("awdl0", &p_ifnet);
if (err) {
printf("interface awdl0 not found\n");
return KERN_SUCCESS;
}
filter.iff_name = "AWDLBlock";
filter.iff_ioctl = awdlblock_ioctl_handler;
iflt_attach(p_ifnet, &filter, &p_filter);
return KERN_SUCCESS;
}I was able to somewhat disable AWDL by doing this like you suggest:
sudo /usr/libexec/airportd en0 prefs AWDLEnabled=YES
And then restarting airportd so that it picks up the change: sudo launchctl kickstart -k system/com.apple.airportd
This worked without having to disable SIP and modify com.apple.airportd.plistIt doesn't take the awdl0 interface down, and I still see some traffic on it, but I can confirm that it disables some awdl features like "Unlock with Watch" and Screen Sharing over awdl. (Screen Sharing will work over your wifi network instead, but normally it'll prefer a direct awdl link)
> sudo /usr/libexec/airportd en0 prefs AWDLEnabled=YES
Wait, why AWDLEnabled = YES? Is it like with those Cisco routers, where "do X" was usually done by negating "do inverse-of-X"? E.g. "no interface up foo" to bring down interface "foo".
Also you can check what your current prefs by just not passing any args after `prefs`:
sudo /usr/libexec/airportd en0 prefsThat prevents it from doing any WiFi direct things, but otherwise would leave it functional.
Yes, Bonjour name resolution, which Screen Sharing uses, can also run over AWDL, but of course it does not have to.
There was a bug in OS X Yosemite and older versions of iOS which caused any AWDL activity to severely increase network jitter and latency; this sounds like a regression.
https://medium.com/@mariociabarra/wifried-ios-8-wifi-perform...
[1] https://owlink.org/wiki/ — note, not exhaustive ex: tethering also leverages awdl.
Intersting!
Starting a few weeks ago, I was screen sharing from a Monterey macbook to a Ventura Beta MacBook, using drag & drop to copy an app over for testing. Both macs were on WiFi. Worked great (~100MB/second).
But about every 5th time, the file transfer rate would drop from 100MB/S to under 100KB/S and stay there. No idea why.
I finally bought a USBC ethernet dongle and put both machines on Ethernet and the problem went away.
I'm now wondering if this is what I was seeing?
Edit to add: The WiFi is Peplink AP One Mini, in case vendor is relevant.
Here's an example of SOF solution: https://apple.stackexchange.com/a/413735
But if you search around the internet you will see different solutions proposed for it, none worked for me except for this script.
This popping up on HN gives me hope that next versions give you at least a tool to disable Wifi direct.
I still have an issue every now again and for whatever reason a reboot addresses it. I will ifconfig down the interface next time. I suspect that will resolve it.
For half a year, it was WiFi and AirDrop hell. Update after update, it didn't matter, the issues were not being fixed. Finally, whichever update it was, fixed it 6 months later. I referred to it as the WiFi Apocalypse of 2014. After that, I always emailed everyone at the beginning of the school year to not install new versions of macOS and iOS when they came out. I would say that if they went against my recommendations and installed anyway, no guarantee that we'd be able to fix any problems they had, and this was their warning, so no complaining.
I would usually send an email about half a year later saying that people can update now if they like. I didn't care whether or not it looked fine within the first month or so. Never again. The WiFi Apocalypse of 2014 was hell. It's weird that this situation seems to be repeating itself.
Both our iPhones seem to have similar issues.
I went mad trying to figure it out with my router/APs etc.
I was certain there is no way it could be Apple’s issue. But in hindsight this makes sense.
Especially so, if Apple is sharing some driver logic between M1 laptops and A16 SOCs on the phones.
Edit: I want to add that this most-noticably manifested as websites loading incompletely. Looking at the network tab, this would show some HTTP requests fail even before establishing a connection. Other requests were fine. So most sites were broken, or don't render correctly without css. Restart was the only fix.
AWDL has been around since, what, 2014? There may be new bugs but it’s hard to believe the principle stopped working as wifi got faster.
Why not just share the command?
This attack requires a malicious server, but it’s still bad practice.
----------------
LOL
Sometimes I am just unable to load any web pages, but I can ping those sites. I have to reboot it regularly to reconnect to the internet. The issue is most likely to occur after waking from sleep.
The issue is so bad that I have to fall back to a Hackintosh at home. I originally was using an Intel-based WiFi card is great; later, I switched to a Broadcom card to enable handoff / AirDrop / AirPlay. After switching, it seems to degrade internet stability. The symptom seems like it has something to do with awdl0, so it might get helped from the post.
All my Windows computers work with no issues on the same network. I followed some instructions online to change the MTU [1] it seems to fix the issue somewhat.
[1]: https://apple.stackexchange.com/questions/177873/full-wi-fi-...
I had that issue quite regularly on Windows and Linux back in the day, never figured out what the cause was.
Periodic reminder that Apple re-enables Bluetooth on every OS update: https://lapcatsoftware.com/articles/bluetooth.html
In my house, all of my devices end up with pretty stable IPs (even non-Apple ones) and I haven't done anything special to configure this. I assume my router holds onto previously-assigned IPs in case the device comes back as long as there's still unassigned IPs available to give out to new devices, though I haven't investigated it.
> bash <(curl -sL https://www.meter.com/awdl.sh)
Eek!
I started pointing directly at the full commit SHA of the version I want to use when pointing dependencies at Github repos, as I have some naïve belief that it'll offer me a reasonable level of protection from the malicious takeover of a repo.
The problem isn't even pasting curl output into sh – it's instructing non-technical users to run any terminal commands, in my opinion.
I started getting packet loss recently, and after being unable to find the cause, I tried upgrading my router. That somehow made things worse -- rather than intermittent packet loss, it would get into a completely unavailable state and not recover. I couldn't even switch to other networks without restarting wifi.
This affected multiple M1 machines and an iPhone, so I was quite sure it was an Apple issue, but wasn't able to find the root-cause. After some limited testing, I'm pretty sure this issue caused both my intermittent packet loss as well as complete downtime.
The steps include downloading a remote script, then entering the password of a privileged user.
Goodness, it would be a shame if someone were to change the contents of that remote script.
Well, it might not happen to those rich Apple developers living in their mansions. It sure does happen to us plebes living in apartment complexes. Years ago my ThinkPad found 70 (!) WiFi networks next to me. AWDL is a nightmare here.
Then switching Wi-Fi to channel 11 seemed to stop interference and I had no problems after that.
Though, I wouldn't use their solution with the script.
while true; do
if ifconfig awdl0 |grep -q "<UP"; then
(set -x; ifconfig awdl0 down)
fi
sleep 1
doneNow that I know this is an issue mainly introduced my Apple on their silicon machines, I have some apologies to make to the WeWork staff.
I'm still on Monterey but have not yet updated to 12.6.1.