Home > Mac administration, Mac OS X, macOS, Unix > Fixing server connection issues by changing network interface order

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:

networksetup -listallnetworkservices

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

Screen Shot 2016 10 25 at 2 36 50 PM

3. Click the Action pop-up menu.

Screen Shot 2016 10 25 at 2 39 22 PM

4. Choose Set Service Order… from the menu.

Screen Shot 2016 10 25 at 2 39 45 PM

5. Drag a network service, such as Ethernet, to the top of the list.

Screen Shot 2016 10 25 at 1 45 11 PM

Screen Shot 2016 10 25 at 1 34 33 PM

6. When finished setting the service order, click the OK button.

Screen Shot 2016 10 25 at 1 34 34 PM

7. To apply the changes, click the Apply button to make the new settings active.

Screen Shot 2016 10 25 at 2 48 15 PM

  1. elvisizer
    October 26, 2016 at 7:41 pm

    I use this snippet to set network service order, very flexible:

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: