Fixing server connection issues by changing network interface order
I had one of my customers report a problem today after applying software updates to his Mac. His Mac had been able to automount certain network shares via NFS before the updates, but was unable to access those shares following the updates.
I connected remotely to the Mac and verified that I was unable to manually mount the NFS mounts.
When I tried to run the showmount command to get a list of the available NFS mounts on the server, I also received a timeout message:
I was about to send this on to the team that handled our NFS shares, when I remembered I hadn’t verified that I could access the server. Sure enough, I couldn’t:
I could ping Yahoo however, so I could contact the internet.
So I couldn’t access an internal network resource, but I could access the internet. What made this puzzling was that I was connecting remotely to the Mac via the IP address associated with this person’s Ethernet address. This IP address should not have had issues accessing internal network resources. What had happened? For more, see below the jump.
When I checked the network interfaces, I noticed that something weird had happened. Normally, the Ethernet interfaces were set to be the first in the network service order. However at some point, the Wi-Fi network interface had become the first network interface in the network service order.
When I checked the Wi-Fi interface, it was set to connect to our guest WiFi network. This is a network used by guests visiting our facility which allows access to the Internet but doesn’t allow access to our internal network.
At that point, the problem became clear. The Mac was trying to access the NFS network shares via Wi-Fi and was not succeeding because the Wi-Fi network didn’t have access to the server. Rather than trying another network interface, the NFS mount attempt just timed out.
The fix was to re-order the network interface order. Since I was working remotely, I ran the command shown below to display the existing network service order:
I then ran the command shown below with root privileges to re-arrange the network service order
networksetup -ordernetworkservices "Ethernet 1" "Ethernet 2" "Wi-Fi" "Bluetooth PAN" "Bluetooth DUN" "FireWire"
Once the new network service order was in place, I checked to make sure the Ethernet interfaces were showing up before WiFi in the service order:
Once the network search order was correct, I verified that I could now connect to the NFS mount that my customer was trying to access.
For those who want to change the network service order via the GUI, see the procedure below:
1. Open System Preferences
2. Select the Network preferences
3. Click the Action pop-up menu.
4. Choose Set Service Order… from the menu.
5. Drag a network service, such as Ethernet, to the top of the list.
6. When finished setting the service order, click the OK button.
7. To apply the changes, click the Apply button to make the new settings active.