Navigating The Network Management With Unix/Linux Commands//
Introduction/
Networking commands in Linux help to manage and troubleshoot network connections. These commands can check connectivity, configure network interfaces, resolve domain names and more. Let's explore these commands with simple explanations, symbols and examples.
Basic Networking Commands/
ping
Symbol: ๐ถ
Description: Checks if a computer is reachable over the network.
Example:
ping
google.com
sends packets to Google and checks the response.
netstat
Symbol: ๐
Description: Shows network connections, routing tables, and interface statistics.
Example:
netstat -a
shows all active connections and listening ports.
ifconfig
Symbol: ๐ป
Description: Configures network interfaces.
Example:
ifconfig eth0
shows the configuration of theeth0
interface.
traceroute vs tracepath
Symbol: ๐ค๏ธ
Description: Tracks the path packets take to reach a destination.
Example:
traceroute
google.com
shows each hop to Google.Note:
tracepath
is similar but doesn't need superuser privileges.
mtr
Symbol: ๐
Description: Combines
ping
andtraceroute
for network diagnostics.Example:
mtr
google.com
provides a continuous update of the path to Google.
nslookup
Symbol: ๐
Description: Queries domain name servers.
Example:
nslookup
google.com
shows the IP address of Google.
telnet
Symbol: ๐
Description: Connects to remote hosts over TCP.
Example:
telnet
google.com
80
connects to Google's web server.
hostname
Symbol: ๐ท๏ธ
Description: Displays or sets the system's hostname.
Example:
hostname
shows the current hostname.
ip
Symbol: ๐
Description: Shows/manages IP addresses and routing.
Example:
ip addr show
displays all IP addresses.
iwconfig
Symbol: ๐ก
Description: Configures wireless network interfaces.
Example:
iwconfig wlan0
shows the configuration of thewlan0
wireless interface.
ss
Symbol: ๐
Description: Displays socket statistics.
Example:
ss -tuln
shows listening ports and their status.
arp
Symbol: ๐
Description: Shows/manages the ARP cache.
Example:
arp -a
displays the ARP table.
dig
Symbol: ๐ง
Description: Queries DNS servers.
Example:
dig
google.com
shows detailed DNS information for Google.
nc (netcat)
Symbol: ๐ ๏ธ
Description: Reads and writes data across network connections.
Example:
nc -zv
google.com
80
checks if Google's web server is up.
whois
Symbol: ๐ต๏ธ
Description: Queries domain registration information.
Example:
whois
google.com
shows registration details for Google.
ifplugstatus
Symbol: ๐
Description: Checks the link status of network interfaces.
Example:
ifplugstatus eth0
checks ifeth0
is connected.
Advanced Networking Commands/
route
Symbol: ๐ฃ๏ธ
Description: Shows/manages IP routing tables.
Example:
route -n
displays the routing table.
nmap
Symbol: ๐ต๏ธโโ๏ธ
Description: Scans networks and hosts for open ports and services.
Example:
nmap
google.com
scans Google for open ports.
wget
Symbol: ๐ฅ
Description: Downloads files from the web.
Example:
wget
http://example.com/file.txt
downloads a file from a website.
watch
Symbol: โฒ๏ธ
Description: Runs a command at regular intervals.
Example:
watch -n 5 df -h
shows disk usage every 5 seconds.
iptables
Symbol: ๐
Description: Manages firewall rules.
Example:
iptables -L
lists current firewall rules.
traceroute
Symbol: ๐ค๏ธ
Description: Shows the route packets take to a network host.
Example:
traceroute
google.com
shows the path to Google.
curl vs wget
Symbol: ๐ค vs. ๐ฅ
Description:
curl
transfers data with URLs, whilewget
downloads files.Example:
curl
http://example.com
: Fetches data from a URL.wget
http://example.com/file.txt
: Downloads a file.
Conclusion/
These commands provide powerful tools to manage and troubleshoot network connections in Linux systems. Understanding and using these commands can help you ensure your network operates smoothly and efficiently. Whether you're checking connectivity, configuring interfaces or securing your network. These commands cover a wide range of networking tasks.
Subscribe to my newsletter
Read articles from Jay Jethawa directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by