Mac Network Commands Cheat Sheet
Mac Network Commands Cheat Sheet
Mac Network Commands Cheat Sheet
com/)
Tiny Deathstars of Foulness
ifconfig en0
networksetup -listlocations
networksetup -getcurrentlocation
Create a network location called Work and populate it with information from the active network connection:
Switch the active location to a location called Work, but also show the GUID of that location so we can make scripties with it laters:
scselect Work
networksetup -listallnetworkservices
Allow an app to communicate outside the system through the application layer firewall:
netstat -nr
Add a route so that traffic for 10.0.0.0/32 communicates over the 10.0.9.2 network interface:
Stop Bonjour:
Start Bojour:
ping -i 5 192.168.210.1
ping -c 5 google.com
ping -f localhost
iostat -d disk0
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s
traceroute google.com
traceroute -n google.com
traceroute -d google.com
netstat -at
netstat -lt
netstat -s
netstat -p igmp
netstat -i
View network information as it happens (requires ntop to be installed):
ntop
nc -v www.apple.com 80
/usr/bin/nc -l 2196
tcpdump -nS
tcpdump -nnvvXS
Capture all the packets for a given port going to a given destination of 10.0.0.48:
Read tcpdump (cap) files and try to make them human readable:
What binaries have what ports and in what states are those ports:
lsof -n -i4TCP
Make an alias for looking at what has a listener open, called ports:
hostname
dscacheutil -flushcache
arp -ad
/Applications/Server.app/Contents/ServerRoot/usr/libexec/afctl -w 10.10.10.2
Finally, the script network_info.sh (http://cs.lth.se/peter-moller/script/network-info-en/) shows information about a Macs network configuration. Both active and inactive
network interfaces are listed, in the order that they are used by the OS and with a lot of details (MAC-address, interface name, router, subnet mask etc.).
Share:
Share
Related
Sticky DHCP Leases in Mac OS X More Information About DHCP Leases in OS X Setup The DCHP Service In Yosemite Server
(http://krypted.com/mac-security/sticky-dhcp- (http://krypted.com/mac-security/more- (http://krypted.com/mac-security/setup-the-
leases-in-mac-os-x/) information-about-dhcp-leases-in-os-x/) dchp-service-in-yosemite-server/)
May 31, 2011 October 7, 2013 October 16, 2014
In "Mac OS X" In "Mac OS X" In "Mac OS X"
Search for:
Search
(http://www.watchmanmonitoring.com/krypted/?utm_source=krypted&utm_medium=banner&utm_campaign=superhero)
(http://www.amazon.com/gp/product/B007NZU73U/ref=as_li_tl?
ie=UTF8&camp=1789&creative=9325&creativeASIN=B007NZU73U&linkCode=as2&tag=charlesedge-20&linkId=EEIYITEIRBNX27V6)
(http://MacTech.com)