OSX Network Cheat Sheet

Set up static IP address

A not recommended way of setting a static IP address is

sudo ifconfig en4 inet netmask

Since OSX has its own config in /Library/Preferences/SystemConfiguration/*, the better way of setting a static IP permanently is

networksetup -setmanual "Ethernet"

Set MAC address of interface

sudo ifconfig en0 ether aa:bb:cc:dd:ee:ff

Reset DNS Cache

sudo killall -HUP mDNSResponder

Show routing table

netstat -nr

Show ARP table

arp -a

Scan Wifi Networks

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s