MacOS – Are there two separate network systems on a Mac? One that is controlled through the GUI in OS X, and one that is controlled through the Terminal

internet-sharingmacosNetworkpreferenceswifi

I have a 2012 refurbished Mac mini running Yosemite 10.10.3. Often I
cannot connect via Wi-fi. I am not usually given a specific reason, but it does actively tell me It can't connect. It does not just fail. However all my iOS devices are connected all the time and work with no issue.

In System Preferences, Network, only the wifi is active. In troubleshooting, I have systematically disabled all other network interfaces, which has helped a little.

However, in Terminal, although everything is off in Mac OS X GUI, ifconfig says everything is up and running here. Lo0, en0, en1, en2, fw0, p2p0, bridge0, awdl0 all firing on all cylinders, promiscuous settings on, multicast, broadcast, higher than normal MTU (lo0 is at 16384) and a bunch of extra MAC addresses I have never seen or ever been able to utilize from Mac OS X.

I know Network System Preferences matches to en0 Ethernet, en1 to Wi-fi, fw0 to FireWire. And of course lo0 is the loopback adapter.

But what about the others? With unknown MAC addresses? Some are piggybacking on my existing. P2p0 uses my Wi-fi MAC address. Bridge0 uses all zeroes which I think means it can use any available MAC address.
When I turned all these extra interfaces off, via Terminal, my connection improves dramatically. But they were off already. They show as such in the network settings.

So Is this a separate system? With different devices? If not, why such discrepancies between whats turned on or off between the OS and Terminal?

What can I do to get a little more control over my network?

Best Answer

There is only one set of network interfaces on any Mac. But they have two different interfaces to manage them with different level of functions:

  • a CLI (Command Line Interface),
  • a GUI (Graphical User Interface).

Moreover, all the network interfaces are named differently through the 2 managment interfaces. Ex.: en0 / CLI = Ethernet / GUI

The GUI is for all users, from beginners to advanced GUI users. The GUI achieve a correct locking mechanism when you use different interfaces or other System Preferences which have to interact with any netwok interface (for ex.: Internet Sharing). This is an interface with a simplified set of "clickdrome windows". This GUI doesn't give you access to all the interfaces functions. This GUI maintains its own database (a set of plist files). This GUI doesn't manage correctly every change you can do at the CLI level. The CLI will make direct use of system calls provided by the underlying operating system (which is a Unix) but won't make any update to the GUI database.

On the other hand, the CLI is for network engineers or system admins who are at ease with pfctl, ifconfig, netstat, traceroute….

My personnal experience is: be cautious when you use CLI that can modify details which are not visible within the GUI but are maintained within the GUI database.