Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I delete a network interface using Terminal

Question:

How do I delete a network interface using Terminal?

Background:

I would think this would be fairly straight forward, but I have not been able to find information on how to do this. We are a school district and have a decent number of computers. We want the machines to be using Wired Ethernet and ONLY that. Students were connecting to neighbors WiFi and skirting around the network content filter.

I do not just want to "down" and interface using "sudo ifconfig en1 down". I want to delete the interface entirely. I realize this is pretty easy using the GUI, but I don't want to touch the machines manually. I am looking to send an ARD Unix command.

Any help would be appreciated. We are using 10.6.2 and 10.4.11.

MacBook Pro 15, Mac OS X (10.6.2), MacBook Pro 15, iMac 20 lab, xserves, AD integration

Posted on Feb 8, 2010 8:35 AM

Reply
18 replies

Feb 9, 2010 10:46 AM in response to R C-R

Good to know, RCR. Thanks for that tip.

As to the OP's issue, how to edit that preference - and it's actually the preference.plist, not NetworkInterfaces as one would presume; I tested it - via the defaults command I don't know. As I mentioned below, the interface is specified by a long alphanumeric string and it's not clear how that could be removed via a defaults command. Just changing the "Inactive" setting doesn't remove it from the GUI listing. It might be possible to remove the entire key set under the NetworkServices in that preference file, but I don't know if that key identifier is the same from computer to computer.

Regards.

Feb 9, 2010 12:00 PM in response to varjak paw

Dave Sawyer wrote:
Good to know, RCR. Thanks for that tip.

As to the OP's issue, how to edit that preference - and it's actually the preference.plist, not NetworkInterfaces as one would presume; I tested it - via the defaults command I don't know. As I mentioned below, the interface is specified by a long alphanumeric string and it's not clear how that could be removed via a defaults command. Just changing the "Inactive" setting doesn't remove it from the GUI listing. It might be possible to remove the entire key set under the NetworkServices in that preference file, but I don't know if that key identifier is the same from computer to computer.

Regards.


I would agree with everything you've said. I modified the configuration via System Preferences GUI and then checked the "/Library/Preferences/SystemConfiguration/ directory and sorted by Modified date. The "preferences.plist" was the most recently modified. Digging deeper as you mentioned, the string toward the bottom showed alpha numerics for the interfaces. Checking these on different machines did prove to be that they were different.

Looks as though you're both right, it can be done via command-line, but not in any kind of viable way since I can't determine how the alpha numerics is generated.

THANKS SO MUCH FOR ALL OF YOUR HELP.

Feb 9, 2010 12:24 PM in response to varjak paw

I believe the long strings are UUID's that relate various pieces of data to each other, generated algorithmically at the time of data creation. For instance, the CurrentSet string refers to a specific one of the Sets dictionaries by its UUID. (Sets appear to correlate closely with Network Locations in the GUI representation.) The Sets dictionaries in turn refer to the various NetworkServices dictionaries that define various properties of the network services in a set by their UUID's. (These seem to correlate with the per location options normally set through the GUI representation.)

Some of these dictionaries apparently are created & populated automatically with default values from system templates when the OS is installed; others, the result of users manually setting preference values.

The defaults delete options should have no problem removing any of these items from the plist; however, I have no idea what this would do. Deleting the entire plist should regenerate a new plist with default values, since this is a tried & true method for eliminating certain kinds of problems that are caused by corrupted plists, but that obviously isn't what the OP is looking for.

How do I delete a network interface using Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.