Networking Commands Made Simple

 

Networking in Linux often feels harder than it actually is. Most of the confusion comes from unfamiliar commands, not complex concepts.

This guide walks through the core Linux networking commands you actually need as a beginner. Each command is shown in its simplest working form, explained clearly, and tied to real IT troubleshooting so you understand not just what to type, but why it matters.

Take this slowly. You do not need to memorize anything. Focus on understanding what each command tells you.


Step 1: Confirm the Network Is Up

Before troubleshooting anything else, you need to answer one basic question:

Is this machine connected to a network?

In Linux, network connections are called interfaces. An interface is simply a network connection, such as Ethernet or Wi-Fi.

Command

ip a

Example Output

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> 
inet 192.168.1.45/24

What This Means

You are looking for three things:

• An interface name like enp0s3 or eth0
• The word UP
• An IP address that starts with numbers such as 192.168

If you see all three, the system is connected to the network and has been given an address.

Real-World Use

When someone reports “the internet is down,” this is the first command to run. If there is no IP address, the issue is local to the machine, not the network.


Step 2: Check Your IP Address Clearly

The previous command shows a lot of information. Sometimes you just want to see the IP address by itself.

Command

ip -4 addr

Example Output

inet 192.168.1.45/24

What This Means

This command shows only IPv4 addresses, which are the most common in beginner environments.

The /24 describes the size of the network. You do not need to memorize this yet.

Real-World Use

This is useful when documenting systems, checking DHCP assignments, or confirming a server received the correct address.


Step 3: Test Basic Connectivity with ping

Once you have an IP address, the next step is to check whether the system can reach another machine.

The ping command sends a small message and waits for a reply.

Command

ping 8.8.8.8

Example Output

64 bytes from 8.8.8.8: time=20 ms

Stop the command with:

Ctrl + C

What This Means

If you see replies, basic networking is working.

If you see timeouts, traffic is being blocked or cannot leave the system.

Real-World Use

This is the fastest way to confirm whether a system can reach the internet at all.


Step 4: Test DNS Separately

A system can have internet access and still fail to load websites. This usually means DNS is broken.

DNS is what converts names into IP addresses.

Command

ping google.com

Example Output

PING google.com (142.250.72.14)

What This Means

If this works, DNS is functioning.

If ping 8.8.8.8 works but this fails, DNS is the problem.

Real-World Use

Separating connectivity problems from DNS problems is a core IT skill. This single test saves time and confusion.


Step 5: View the Default Gateway

The gateway is where traffic leaves your local network. If it is incorrect, nothing reaches the internet.

Command

ip route

Example Output

default via 192.168.1.1 dev enp0s3

What This Means

The default via line shows the gateway address. This is usually your router or firewall.

Real-World Use

Incorrect gateways are common after manual configuration, cloning virtual machines, or restoring backups.


Step 6: Check Active Network Connections

Sometimes networking works, but a service is not reachable. This is often because nothing is listening on the expected port.

Command

ss -tuln

Example Output

LISTEN 0 128 0.0.0.0:22

What This Means

This shows services that are waiting for incoming connections.

Port 22 indicates SSH is running.

Real-World Use

This command confirms whether a service is actually running and available on the network.


Common Beginner Mistakes

Running Commands Without Enough Permission

Some networking commands require administrative access. If output looks incomplete, retry using:

sudo <command>

Forgetting to Stop ping

The ping command runs continuously. Stop it with:

Ctrl + C

Mixing Up IP and DNS Problems

Always test an IP address first, then test a name. This order prevents wasted troubleshooting time.


Practical Troubleshooting Example

A user reports they cannot access a website.

Here is a simple, real-world process:

  1. Check the interface:

    ip a
  2. Confirm the IP address:

    ip -4 addr
  3. Test internet connectivity:

    ping 8.8.8.8
  4. Test DNS:

    ping google.com

In under two minutes, you know exactly where the problem is. This is how effective troubleshooting works.


Optional Next Step

Once these commands feel comfortable, try:

nmcli device status

This shows network state in a clean summary. You do not need to master it yet. Just recognize what it is showing you.


Final Thoughts

These networking commands are foundational. They appear in real IT environments every day.

Work through them a few times. Let the output make sense before worrying about speed. Confidence comes from understanding, not memorization.

When these basics feel natural, more advanced networking becomes much easier to learn.