Configure MAC OSX Network Interface from the Command Line

Configure MAC OSX Network Interface from the Command Line

By : -

Command line network configuration for the MAC is quite a bit different when compared to Linux or Unix. The networksetup command is used instead of ifconfig to configure devices.

The first step is to get a list of all network services – these are really physical and virtual devices, VPNs, etc..

networksetup -listallnetworkservices

The next step is to get the current settings for the network service that you might want to configure – the following example is using the service “Ethernet” and is enclosed in quotes as some of the services have spaces in the names:

networksetup -getinfo "Ethernet"

To configure an interface manually, use something like the following:

networksetup -setmanual "Ethernet"

Confirm that the settings are correct by issuing the getinfo command once more:

networksetup -getinfo "Ethernet"

Setup DNS servers for a specific interface named “Wi-Fi”:

networksetup -setdnsservers "Wi-Fi"

how do I create a new interface? Eg I want my loopback device (lo0) to show in network settings. So I can use airplay with the television. There is only wifi internet and I can’t share the internet from wifi to wifi. so I need another interface to share internet from.


Leave a Reply

Your email address will not be published. Required fields are marked *