1. Find Your IP Address (ipconfig / ifconfig)

One of the most fundamental tasks is finding your own device's IP address on the network. This is essential for configuring services or troubleshooting. Your IP address identifies your device on the local network and is required for tasks like file sharing, remote desktop, or setting up a server.

There are two main types of IP addresses you might see:

  • IPv4: The most common format, looks like 192.168.1.10.
  • IPv6: A newer format, looks like fe80::1c2d:3eff:fe4b:5a6b.

To find your IP address, use the following commands in your terminal or command prompt:

Commands

Operating System Command
Windows ipconfig
macOS / Linux ifconfig or ip addr

How to Read the Output

  • Look for entries labeled IPv4 Address or inet (for IPv4) and inet6 (for IPv6).
  • On Windows, your local IP will usually be under the Wireless LAN adapter Wi-Fi or Ethernet adapter section.
  • On macOS/Linux, check the output for your active network interface (often en0, wlan0, or eth0).

Example Output

Windows:
   IPv4 Address. . . . . . . . . . . : 192.168.1.10

Linux/macOS:
   inet 192.168.1.10  netmask 255.255.255.0  broadcast 192.168.1.255
                    

Knowing your IP address helps you connect devices, troubleshoot connectivity, and understand your network setup.

2. Check Network Connectivity (ping)

The `ping` command is a simple yet powerful tool to check if a device is reachable over the network. It sends a small packet of data to a target IP address or domain name and waits for a reply, measuring the round-trip time.

Example Usage

ping google.com

This command will send packets to Google's servers and show you if they respond, along with the time it takes for the packets to travel there and back. It's an essential first step in diagnosing any "the internet is down" issue.

3. Trace the Route (tracert / traceroute)

Ever wonder what path your data takes to get to a server across the world? The `traceroute` command (or `tracert` on Windows) shows you every "hop" (router) your connection passes through to reach its destination.

Commands

Operating System Command
Windows tracert google.com
macOS / Linux traceroute google.com

This command will display each hop along the route, showing you how many milliseconds it takes for each step. It's useful for diagnosing where delays or failures occur in the network path.

4. Look Up DNS Records (nslookup)

The `nslookup` (Name Server Lookup) command is a powerful tool for querying the Domain Name System (DNS) to find the IP address associated with a domain name, and vice-versa.

Example Usage

nslookup google.com

This command will return the IP addresses that Google's domain name points to. It's incredibly useful for diagnosing website access issues or understanding how domain names resolve to IP addresses.

5. View Active Connections (netstat)

The `netstat` command displays active network connections, routing tables, and a number of network interface statistics. It's a great way to see what programs on your computer are communicating over the network.

Example Usage

netstat -an

The `-an` flag will show all connections and listening ports in numerical form, making it easy to spot unusual activity or troubleshoot connection issues.

6. Check Network Configuration (ipconfig / ifconfig)

Understanding your network configuration is crucial for troubleshooting. The `ipconfig` command on Windows and `ifconfig` (or `ip addr`) on macOS/Linux show detailed information about your network interfaces, including IP addresses, subnet masks, and default gateways.

Commands

Operating System Command
Windows ipconfig /all
macOS / Linux ifconfig or ip addr show

This will provide a comprehensive overview of your network setup, helping you identify misconfigurations or issues with your network interfaces.

7. Monitor Network Traffic (tcpdump / Wireshark)

For more advanced users, monitoring network traffic can provide deep insights into what's happening on your network. The `tcpdump` command-line tool captures and displays packets being transmitted or received over a network interface. Wireshark is a graphical tool that provides similar functionality with a user-friendly interface.

Commands

Operating System Command
Linux / macOS sudo tcpdump -i eth0
Windows Use Wireshark for a GUI-based approach.

These tools allow you to analyze network traffic in detail, helping you identify issues like packet loss, latency, or unauthorized access attempts.

8. Check Firewall Rules (iptables / netsh)

Firewalls are essential for protecting your network, but misconfigured rules can block legitimate traffic. The `iptables` command on Linux and `netsh` on Windows allow you to view and manage firewall rules.

Commands

Operating System Command
Linux sudo iptables -L
Windows netsh advfirewall firewall show rule name=all

These commands will display the current firewall rules, helping you troubleshoot connectivity issues related to blocked ports or protocols.

9. Check Network Speed (speedtest-cli)

To measure your internet connection speed, the `speedtest-cli` tool is a great command-line utility. It connects to the nearest Speedtest server and measures your download and upload speeds.

Example Usage

speedtest-cli

This will run a speed test and display your current download and upload speeds, helping you understand your network performance.

10. Check Network Interface Statistics (ethtool)

The `ethtool` command provides detailed information about your network interfaces, including speed, duplex mode, and statistics like packet errors and collisions.

Example Usage

sudo ethtool eth0

This will show you the status of the specified network interface, helping you diagnose issues related to hardware or driver problems.

11. Check ARP Cache (arp)

The `arp` command allows you to view and manage the Address Resolution Protocol (ARP) cache, which maps IP addresses to MAC addresses on your local network. This is useful for diagnosing issues related to device communication.

Example Usage

arp -a

This will display the current ARP cache entries, helping you identify devices on your local network.

12. Check Network Latency (mtr)

The `mtr` (My Traceroute) command combines the functionality of `ping` and `traceroute`, providing a real-time view of network latency and packet loss across multiple hops.

Example Usage

mtr google.com

This will show you the latency and packet loss for each hop along the route to Google's servers, helping you diagnose network issues more effectively.

13. Check Network Bandwidth Usage (nload)

The `nload` command provides a real-time view of network bandwidth usage, showing incoming and outgoing traffic on your network interfaces.

Example Usage

nload

This will display a graphical representation of your network traffic, helping you monitor bandwidth usage and identify potential bottlenecks.

14. Monitor Network Connections (netstat)

The `netstat` command displays active network connections, routing tables, and interface statistics. It's a valuable tool for diagnosing network issues and understanding your system's network activity.

Example Usage

netstat -tuln

This will show you all active listening ports and established connections, helping you identify potential issues or unauthorized access.

15. Check Open Ports (ss)

The `ss` (Socket Stat) command is a utility to investigate sockets. It can display more detailed information about TCP and UDP connections than the older `netstat` command.

Example Usage

ss -tuln

This will show you all active listening ports and established connections, helping you identify potential issues or unauthorized access.

16. Check Network Interface Status (ip link)

The `ip link` command provides information about the status of network interfaces, including whether they are up or down, and their MAC addresses.

Example Usage

ip link show

This will display the status of all network interfaces, helping you diagnose issues related to connectivity or hardware problems.

17. Check Network Configuration (nmcli)

The `nmcli` command is a command-line interface for NetworkManager, allowing you to manage network connections and configurations on Linux systems.

Example Usage

nmcli device status

This will show you the status of all network devices, helping you manage and troubleshoot network connections.

18. Check Network Interface Statistics (ifstat)

The `ifstat` command provides real-time statistics for network interfaces, showing the amount of data transmitted and received.

Example Usage

ifstat

This will display a continuous update of network traffic statistics, helping you monitor bandwidth usage and identify potential bottlenecks.

19. Check Network Interface Speed (ethtool)

The `ethtool` command provides detailed information about network interfaces, including speed, duplex mode, and statistics like packet errors and collisions.

Example Usage

sudo ethtool eth0

This will show you the status of the specified network interface, helping you diagnose issues related to hardware or driver problems.

20. Check Network Interface MTU (ip link)

The Maximum Transmission Unit (MTU) is the largest size of a packet that can be sent over a network interface. The `ip link` command allows you to view and change the MTU for network interfaces.

Example Usage

ip link show eth0

This will display the MTU for the specified network interface, helping you optimize network performance and troubleshoot issues related to packet fragmentation.

21. Check Network Interface Promiscuous Mode (ip link)

Promiscuous mode allows a network interface to receive all packets on the network, not just those addressed to it. This is useful for network monitoring and troubleshooting.

Example Usage

ip link show eth0

This will show whether promiscuous mode is enabled for the specified network interface, helping you diagnose issues related to packet capture or monitoring.

22. Check Network Interface Duplex Mode (ethtool)

Duplex mode refers to the ability of a network interface to send and receive data simultaneously. The `ethtool` command allows you to view and change the duplex mode for network interfaces.

Example Usage

sudo ethtool eth0

This will show you the duplex mode (full or half) for the specified network interface, helping you optimize network performance and troubleshoot issues related to data transmission.

23. Check Network Interface Statistics (ifconfig)

The `ifconfig` command is used to configure and display network interface parameters. It can also show statistics about the network interfaces, such as the number of packets transmitted and received.

Example Usage

ifconfig eth0

This will display detailed information about the specified network interface, including its IP address, netmask, and statistics about data transmission.

24. Check Network Interface Status (ip addr)

The `ip addr` command provides detailed information about network interfaces, including their status, IP addresses, and MAC addresses.

Example Usage

ip addr show eth0

This will display the status of the specified network interface, helping you diagnose issues related to connectivity or hardware problems.

25. Check Network Interface Configuration (nmcli)

The `nmcli` command is a command-line interface for NetworkManager, allowing you to manage network connections and configurations on Linux systems.

Example Usage

nmcli connection show

This will display all configured network connections, helping you manage and troubleshoot network configurations.

26. Check Network Interface Statistics (sar)

The `sar` (System Activity Report) command provides detailed statistics about system performance, including network interface statistics.

Example Usage

sar -n DEV 1

This will display network interface statistics every second, helping you monitor bandwidth usage and identify potential bottlenecks.

27. Check Network Interface Errors (ifconfig)

The `ifconfig` command can also display errors related to network interfaces, such as packet drops or collisions.

Example Usage

ifconfig eth0

This will show detailed information about the specified network interface, including any errors that have occurred during data transmission.

28. Check Network Interface MTU (ip link)

The Maximum Transmission Unit (MTU) is the largest size of a packet that can be sent over a network interface. The `ip link` command allows you to view and change the MTU for network interfaces.

Example Usage

ip link show eth0

This will display the MTU for the specified network interface, helping you optimize network performance and troubleshoot issues related to packet fragmentation.

29. Check Network Interface Promiscuous Mode (ip link)

Promiscuous mode allows a network interface to receive all packets on the network, not just those addressed to it. This is useful for network monitoring and troubleshooting.

Example Usage

ip link show eth0

This will show whether promiscuous mode is enabled for the specified network interface, helping you diagnose issues related to packet capture or monitoring.

30. Check Network Interface Duplex Mode (ethtool)

Duplex mode refers to the ability of a network interface to send and receive data simultaneously. The `ethtool` command allows you to view and change the duplex mode for network interfaces.

Example Usage

sudo ethtool eth0

This will show you the duplex mode (full or half) for the specified network interface, helping you optimize network performance and troubleshoot issues related to data transmission.

2. Test Connectivity (ping)

The `ping` command is your best friend for checking if a device is reachable over the network. It sends a small packet of data to a target and waits for a reply, measuring the round-trip time.

Example Usage

ping google.com

This will show you if you can reach Google's servers and how long it takes for the data to travel there and back. It's the first step in diagnosing any "the internet is down" issue.

3. Trace the Route (tracert / traceroute)

Ever wonder what path your data takes to get to a server across the world? The traceroute command shows you every "hop" (router) your connection passes through to reach its destination.

Commands

Operating System Command
Windows tracert google.com
macOS / Linux traceroute google.com

4. Look Up DNS Records (nslookup)

The `nslookup` (Name Server Lookup) command is a powerful tool for querying the Domain Name System (DNS) to find the IP address associated with a domain name, and vice-versa.

Example Usage

nslookup google.com

This will return the IP addresses that Google's domain name points to. It's incredibly useful for diagnosing website access issues.

5. View Active Connections (netstat)

The `netstat` command displays active network connections, routing tables, and a number of network interface statistics. It's a great way to see what programs on your computer are communicating over the network.

Example Usage

netstat -an

The `-an` flag will show all connections and listening ports in numerical form, making it easy to spot unusual activity.