Networking at the Command Line
Focus on some network utilities used for troubleshooting, testing and diagnosing network connectivity issues.
Commands
ping
ping- send one ore more ICMP ECHO_REQUEST packages to network hosts.it is part of the
iputilspackage
ping google.com
PING google.com (142.251.209.14) 56(84) bytes of data.
64 bytes from mil04s50-in-f14.1e100.net (142.251.209.14): icmp_seq=1 ttl=128 time=37.6 ms
64 bytes from mil04s50-in-f14.1e100.net (142.251.209.14): icmp_seq=2 ttl=128 time=33.2 ms
64 bytes from mil04s50-in-f14.1e100.net (142.251.209.14): icmp_seq=3 ttl=128 time=32.9 ms
64 bytes from mil04s50-in-f14.1e100.net (142.251.209.14): icmp_seq=4 ttl=128 time=33.6 ms
# It continuee the ping until stop (Ctrl+C)
# Ping a certain number of times
ping -c 2 google.com
PING google.com (142.251.209.46) 56(84) bytes of data.
64 bytes from mil04s51-in-f14.1e100.net (142.251.209.46): icmp_seq=1 ttl=128 time=34.5 ms
64 bytes from mil04s51-in-f14.1e100.net (142.251.209.46): icmp_seq=2 ttl=128 time=34.7 ms
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 34.493/34.606/34.719/0.113 msifconfig
ifconfig- configure a network interfaceit is part of the
net-toolspackage
ip
ip- powerful tool for configuring network interfaces
route
route- show and manipulate the IP routing table
nslookup / dig
nslookup- query Internet name servers interactivelydig- DNS lookup utility. More information thannslookup
netstat
netstat- print network connections, routing tables, interface statistics, masquerade connections, and multicast memberโships
ss
ss- it replaces the netstat command
๐ More on checking for listening ports here.
Last updated
Was this helpful?