Resolving a Strange UniFi and macOS Incompatibility
I recently upgrade my network stack to a Ubiquiti UniFi-based setup. Overall,it's been an awesome upgrade and I've really enjoyed working with the hardware.However, I was getting bit by a pretty serious bug when it came to my primarydesktop machine - a 2018 Mac Mini.
My current network rack setup is as follows (I'll get these on my gear pagesometime soon):
- UniFi Switch PRO 24 PoE -Connected to UDM-Pro viaDirect Attach Copper Cable, SFP+
- Also known as ' sleeping sickness,' but idifferent from the sleeping sickness that the tsetse fly transmits. Doctors believe it to be viral, but the exact virus has yet to be determined. The disease is characterized by a high fever, sore throat, headache, weakness, tremors, and falling asleep anywhere.
- Thanks Charlie, do you run it on MacOsX or Linux (cause on linux it's OK). It seems that it stopps on the while loop! I added the old printf debug to the code (thanks:-) and got just: About to read socket. Strange thing on this mac box i have all permissions on the desktop. – funnyCoder Jul 29 '11 at 22:23.
Currently, everything is connected to the 24-port switch, generally with powercoming from the PoE-functionality it offers. The network was simple at the time,with just the primary LAN and two WLANs (one for regular use, the other for IoTdevices), and relatively standard-out-of-the-box configuration.
I just noticed a strange hidden file in my Application folder (I have hidden files visible) It is named Z2 and is a Unix executable. It’s only on one of my 2 macs. I ran a malware bytes scan and it didn’t find anything. Hold down the keys until your Mac reboots 5. Let go of the keys To reset SMC. Turn off your Mac 2. Hold down Control + Shift + Option and press power 3. Hold the buttons for 10-15 sec 4. Release the keys and restart your Mac After you’re done, repeat macOS Catalina installation from scratch. Free up space on your drive. Missing icons and symbols on Mac OS X. I had some strange effects on my new MacBook Pro (Retina, 2013). After waking up from hibernation, icons from at least Finder's and Mail's toolbar were missing, symbols from Finder's siderbar were missing, icons in the menu bar had disappered or were crippled, and some icons in the dock had been replaced by a colorful square.
A Strange Disease Mac Os Catalina
I was assigning static IP addresses for some of the primary devices on thenetwork, such as my NAS and primary workstations. Everything was workingbeautifully, with one huge exception: my Mac Mini was constantly losing internetaccess.
Debugging the Mac Mini Connectivity
When working with the Mac Mini, I was able to assign a static IP, access allnetwork resources, and for a short period of time I was able to access theinternet (I would run speed tests and browse via Safari). However, after a fewminutes, I would lose connectivity to the internet, but not the network. A speedtest would not run, and browsing the internet only worked for domains I hadpreviously visited.
Knowing that final point, I assumed there was an issue with DNS. If I usedanother browser, such as Chrome, that didn't use some of the baked-in macOSfunctionality, the internet would mostly work, albeit very slowly.
I started all possible debugging steps I could think of:
Flushing the local DNS cache and killing
mDNSResponder
. I even created analias to make it easier in zsh:alias flushdns='sudo ifconfig en0 down; sudo ifconfig en1 down; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponderHelper; sudo killall -HUP mDNSResponderHelper; sudo dscacheutil -flushcache; sudo ifconfig en1 up; sudo ifconfig en0 up'
Flushing locally cached routes to see if the gateway was interfering. Again,created an alias since I was running the command so frequently:
alias resetroutes='sudo ifconfig en0 down; sudo ifconfig en1 down; sudo route -n flush; sudo route -n flush; sudo route -n flush; sudo ifconfig en0 up; sudo ifconfig en1 up'
Logging into the UDM-Pro via
ssh
and monitoring the logs viatail -f /var/log/message
to see if the firewall was blocking traffic- Creating firewall rules to allow all traffic both in and out of the LANand WAN
- Enabling and disabling any settings that looked at packets: Deep-PacketInspection, IGMP Snooping, DHCP Snooping, DHCP Guarding, etc.
- Disabling static IP assignment and just utilizing DHCP.
- Clearing all macOS caches viaOnyx andCleanMyMac X - both excellent tools that Ihighly recommend.
- Reinstalling macOS to ensure local system files or configuration weren'tcorrupted.
- Comparing settings to my MacBook Pro, that has both ethernet and WiFI setup(just like the Mac Mini), but had absolutely no issues – no huge configurationdifferences.
- Ran Wireshark to hunt down any traffic thatlooked worrisome to any degree.
- Resetting the UDM-Pro back to factory settings and reconfiguring it.
During this debug process, there were moments where the internet connectivityseemed to come back. For example, when I switched static IP address assignmentoff and renewed my IP address via DHCP, I would get access again for a fewminutes. From there, I tested manually changing my address to a different IPaddress, with each time giving me access for a brief window yet again.
As my last step, when I decided to reset the UDM-Pro back to factory, I wentthrough every possible internet-bound setting with a fine-toothed comb, turn iton and off to see when my connectivity would come back. And finally, I found theculprit.
UPnP
From Wikipedia:
Universal Plug and Play (UPnP) is a set of networking protocols that permitsnetworked devices, such as personal computers, printers, Internet gateways,Wi-Fi access points and mobile devices to seamlessly discover each other'spresence on the network and establish functional network services for datasharing, communications, and entertainment. UPnP is intended primarily forresidential networks without enterprise-class devices.
In the new UniFi settings pages, you can configure this via this page:
However,some security researches consider UPnP to be a security risk,as it allows applications and services to open and close external ports on yourgateway. While this can be a very useful feature, especially for those of ususing Game Consoles where a large number of ports may be required to allowaccess to online game networks, it does give a pause for concern.
Generally, I'm ok with leaving this setting on since I have a 'small' networkthat I manage well. It never crossed my mind that this could be the issue in myMac Mini woes. Once I disabled this setting in UniFi, everything workedbeautifully. I was able to set my static IP address, have both my ethernet andWiFi adapters enabled, and use all internet services.
While this does fix my issue, it does give me some concern at the same time.That means there are services on my Mac Mini asking for UPnP configurationchanges (probably excessively). I still need to find what those services are;they would most likely be third-party as my MacBook Pro had no issues and that'sa relatively stock installation of macOS.
Conclusion
A Strange Disease Mac Os 11
I wish I would have thought to disable UPnP earlier on in the process. I spentprobably twenty or more hours debugging this issue, just to find it was a singlecheckbox. Hopefully if you run into this issue, you found this post quickly.There was one post in theUbiquiti Community (Apple Mac Woes via Ethernet and WiFi)that looked very close to my problem, but that was a couple years old with noanswer – hopefully they found a similar solution.