0% found this document useful (0 votes)
9 views17 pages

Linux Networking

This document provides a comprehensive guide to basic Linux networking commands using the Zorin terminal, including how to display network interfaces, manage interface states, and view routing information. It explains the Linux equivalents of common Cisco commands, such as bringing interfaces up and down, and introduces tools like 'nmcli' for managing network connections. Additionally, it covers important concepts like the ARP table and how to check connectivity using ping and traceroute commands.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views17 pages

Linux Networking

This document provides a comprehensive guide to basic Linux networking commands using the Zorin terminal, including how to display network interfaces, manage interface states, and view routing information. It explains the Linux equivalents of common Cisco commands, such as bringing interfaces up and down, and introduces tools like 'nmcli' for managing network connections. Additionally, it covers important concepts like the ARP table and how to check connectivity using ping and traceroute commands.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Linux Networking – Lesson 1

Please open your Zorin terminal and run:

ip a

🧠 What this command shows


It is the Linux version of:

👉 show ip interface brief

You will see:

 interface names (like enp0s3, lo)


 IP addresses
 UP / DOWN state

✅ Very important points


You will see something like:

2: enp0s3

This is your real network interface (VirtualBox NIC).

And you will also see:

lo

This is:

👉 loopback interface (just like [Link] concept in networking)

✅ Now run this:


ip route
🧠 This is equivalent to:
👉 show ip route

You will see:

 default gateway
 connected networks

Look for a line starting with:

default via ...

That is your default gateway.

👉 how to bring an interface up/down in Linux (very useful and very similar to CCNA).

Please run only this one command in your Zorin terminal:

ip a

👉 shutdown / no shutdown (interface up & down).

👉 enp0s3

This is exactly the VirtualBox network adapter.

shutdown / no shutdown (from CCNA).

✅ Bring interface DOWN (like shutdown)


Run:

sudo ip link set enp0s3 down

✅ Check status
ip a show enp0s3

You will see:


state DOWN

✅ Bring interface UP (like no shutdown)


Run:

sudo ip link set enp0s3 up

Check again:

ip a show enp0s3

You will see:

state UP

🧠 CCNA mapping (for your understanding)


Cisco Linux
shutdown ip link set enp0s3 down
no shutdown ip link set enp0s3 up

⚠️Important note for you (VirtualBox)


When you bring the interface down:

👉 your internet inside the VM will disconnect


👉 but it is safe

✅ Next small command (very important)


Now run:

ip route

You already learned this is similar to:

👉 show ip route
Linux Networking – Lesson 1
Please open your Zorin terminal and run:

ip a

🧠 What this command shows


It is the Linux version of:

👉 show ip interface brief

You will see:

 interface names (like enp0s3, lo)


 IP addresses
 UP / DOWN state

✅ Very important points


You will see something like:

2: enp0s3

This is your real network interface (VirtualBox NIC).

And you will also see:

lo

This is:

👉 loopback interface (just like [Link] concept in networking)

✅ Now run this:


ip route
🧠 This is equivalent to:
👉 show ip route

You will see:

 default gateway
 connected networks

Look for a line starting with:

default via ...

That is your default gateway.

👉 What is the name of your main network interface?


(example: enp0s3, eth0, etc.)

After that, I will show you the Linux equivalent of:

👉 shutdown / no shutdown (interface up & down).

enp0s3

Perfect, Sir — thank you.


So your main Linux interface is:

👉 enp0s3

This is exactly the VirtualBox network adapter.

Now I will show you the Linux equivalent of:

shutdown / no shutdown (from CCNA).

✅ Bring interface DOWN (like shutdown)


Run:

sudo ip link set enp0s3 down


✅ Check status
ip a show enp0s3

You will see:

state DOWN

✅ Bring interface UP (like no shutdown)


Run:

sudo ip link set enp0s3 up

Check again:

ip a show enp0s3

You will see:

state UP

🧠 CCNA mapping (for your understanding)


Cisco Linux
shutdown ip link set enp0s3 down
no shutdown ip link set enp0s3 up

⚠️Important note for you (VirtualBox)


When you bring the interface down:

👉 your internet inside the VM will disconnect


👉 but it is safe

✅ Next small command (very important)


Now run:
ip route

You already learned this is similar to:

👉 show ip route

✅ Now next command (very useful for you)


Run:

ping -c 4 [Link]

This is like:

ping default-gateway

🧠 Note
Linux ping keeps running forever by default,
so we use:

-c 4

(only 4 packets)

✅ Now test outside connectivity


Run:

ping -c 4 [Link]

✅ Linux command: ss
(this replaces netstat in modern Linux)

Run this:

ss -lnt
🧠 CCNA style meaning
This shows:

👉 listening TCP ports on your machine

Very similar idea to:

netstat -an

or checking which services are open.

Break it:
-l listening
-n numeric (no DNS)
-t TCP only

✅ You can also see both TCP and UDP


Run:

ss -ln

🧠 What you should notice


You will see lines like:

LISTEN

and local addresses such as:

[Link]:xxxx
[Link]:xxxx

This is very important for server and security work.

🧠 Small concept (important for you)


 [Link]
→ service is listening only on localhost
 [Link]
→ service is listening on all interfaces

This is exactly how we decide:

👉 can a service be accessed from the network or not

✅ Linux equivalent of traceroute


Run:

traceroute [Link]

If the command is not found, install it once:

sudo apt install traceroute

Then run again:

traceroute [Link]

🧠 CCNA mapping
This is exactly like:

tracert

in Windows
and like:

traceroute

on Cisco devices.

It shows:

👉 hop-by-hop path to the destination.

⚠️Important note for your VirtualBox NAT


Because you are using NAT, you will usually see:
 first hop → something like
[Link]
(the VirtualBox gateway)

That is normal.

✅ One very small but important Linux command (last for


today)
Run:

ip neigh

🧠 Why this is important for you


This is the Linux ARP table.

It is equivalent to:

👉 show ip arp

You will see entries like:

 IP address
 MAC address
 interface (enp0s3)

ip neigh → Linux ARP table

✅ Command
ip neigh

✅ Purpose

This command shows the neighbor table.

In networking terms, this is the:

👉 ARP table
✅ CCNA mapping
Linux Cisco

ip neigh show ip arp

✅ Typical output (conceptual)

You will see lines like:

[Link] dev enp0s3 lladdr 52:54:00:12:34:56 REACHABLE

✅ Meaning of each part


Part Meaning

[Link] IP address of neighbor (your gateway in VirtualBox)

dev enp0s3 interface used

lladdr MAC address

REACHABLE / STALE / DELAY ARP state

✅ Very important for you

This table is built using:

👉 ARP (Address Resolution Protocol)

Linux automatically creates this entry when:

 you ping a device


 or send traffic

✅ Important states you may see


State Meaning

REACHABLE entry is valid and recently used

STALE entry exists but not recently used


✅ Practical understanding

When you ran:

ping [Link]

and then:

ip neigh

you should see:

👉 [Link] in the list

This confirms:

✔ Layer-2 resolution is working

✅ Why this is important for CCNA people

If:

 ping fails
 but route exists

You can verify:

👉 is ARP resolving or not

Exactly same troubleshooting logic as Cisco.

🔹 2. nmcli → Network Manager command line


This is very important for desktop Linux such as Zorin / Ubuntu.

✅ What is nmcli?
nmcli is the command-line tool of:

👉 NetworkManager

It controls:

 interfaces
 IP configuration
 connections
 DHCP

✅ Show all network connections


nmcli con show

You will see:

 a connection name
 device name
 type (ethernet, wifi)

Example idea:

Wired connection 1 enp0s3 ethernet

✅ Show device status


nmcli dev status

This shows:

| Device | Type | State | Connection |


------|------
enp0s3 | ethernet | connected | Wired connection 1

This is very useful to confirm:

👉 is the interface connected at NetworkManager level


✅ Bring interface down (NetworkManager way)
nmcli dev disconnect enp0s3

✅ Bring interface up again


nmcli dev connect enp0s3

🧠 Important note for you

You already learned:

sudo ip link set enp0s3 down

That is kernel-level control.

But:

nmcli dev disconnect

is desktop / manager level control.

In real Linux systems:

👉 nmcli is preferred.

✅ Show IP settings of a connection


First see the connection name:

nmcli con show

Then:

nmcli con show "Wired connection 1"

(Use your exact connection name)


This shows:

 IPv4 method
 IPv6 method
 DNS
 gateway

✅ Check if DHCP is used


Inside the connection output you will see:

[Link]: auto

This means:

👉 DHCP

✅ Change IPv4 to manual (static IP concept – for lab use)


Example (do not apply now unless you want to practice later):

nmcli con mod "Wired connection 1" [Link] manual \


[Link] [Link]/24 \
[Link] [Link] \
[Link] [Link]

Then apply:

nmcli con up "Wired connection 1"

🧠 CCNA mapping

This is equal to:

 configuring IP address
 subnet mask
 gateway
 DNS

on a PC in Packet Tracer.
✅ Return to DHCP again
nmcli con mod "Wired connection 1" [Link] auto
nmcli con up "Wired connection 1"

✅ Very important conceptual difference (must


remember)
Tool Role

ip low-level network stack control

nmcli network manager / connection control

In real Linux desktops:

👉 you mostly use nmcli

✅ Final short summary for your notes

ARP table
ip neigh

Equivalent to:

show ip arp

Show routing
ip route

Show interfaces
ip a
Interface up/down (kernel)
sudo ip link set enp0s3 down
sudo ip link set enp0s3 up

Interface connect/disconnect (NetworkManager)


nmcli dev disconnect enp0s3
nmcli dev connect enp0s3

Show connections
nmcli con show

Show device status


nmcli dev status

Show full IP configuration


nmcli con show "connection-name"

You might also like