Difference between revisions of "User:Saul/networking"

From Organic Design wiki
m (TCPDUMP)
m (IP)
Line 24: Line 24:
 
</source>
 
</source>
  
=== IP ===
+
=== ip ===
 
<source lang="bash">
 
<source lang="bash">
 
# Show configured interfaces
 
# Show configured interfaces

Revision as of 21:46, 3 November 2020

Useful Commands

General

# Ping with a payload of 500 bytes 3 times
ping -s 500 -c 3 <HOSTNAME>

# Traceroute to show a path to HOSTNAME
traceroute <HOSTNAME>

DNS

# Resolve hostname to ip address where type = {A, AAAA, MX, NS...}
dig <TYPE> <HOSTNAME>

# Reverse dns lookup
dig -x <ADDRESS>

# Lookup using host
host <HOSTNAME or ADDRESS>

# Find who is responsible for a subnet.
whois <ADDRESS>

ip

# Show configured interfaces
ip address show

# Show info for the interface IFACE
ip address show dev <IFACE>

# Show configured routes
ip route show

tcpdump

tcpdump is the command line alternative to the GUI Wireshark.

# Capture packets on an interface.
tcpdump -i <IFACE>

# Write capture to a file
tcpdump -i <IFACE> -w <FILENAME>

# Read a capture file
tcpdump -r <FILENAME>