Many advanced network configuration commands can be reached with the scutil command line tool. Launch Terminal.app and run:
ENABLE_EXPERIMENTAL_SCUTIL_COMMANDS=1 scutil –net, then type help and press the Return key to see the available options.
For example:
localhost:~ user$ ENABLE_EXPERIMENTAL_SCUTIL_COMMANDS=1 scutil –net
set “Automatic” selected
> help
Available commands:
help : list available commands
f.read file : process commands from file
quit [!] : quit
commit : commit any changes
apply : apply any changes
create interface [ | ]
create protocol
create ser …
Source: Mac OSX Hints