🚀 Navigating the Network: Essential Linux Commands for Connectivity🌐
Introduction to Networking 🌐
Networking is like the magical web that connects computers, devices, and systems, enabling them to communicate and share resources. Imagine you have a bunch of friends spread across the world. Networking is like the internet that lets you chat, share photos, and play games with them in real-time! Let's break down the basics of networking in simple terms.
What is Networking?
Networking refers to the practice of linking multiple computing devices together to share data and resources. This can include anything from internet access and file sharing to video conferencing and online gaming. The key components of a network are:
Devices: Computers, smartphones, servers, routers, etc.
Connections: Wired (like Ethernet cables) or wireless (like Wi-Fi).
Protocols: Rules that define how data is transmitted and received.
Why is Networking Important? 🧩
Communication: Enables instant messaging, email, and video calls.
Resource Sharing: Allows sharing of printers, files, and internet connections.
Data Exchange: Facilitates data transfer between devices, like syncing your phone and laptop.
Centralized Management: Helps in managing resources centrally, making updates and security easier.
Simple Networking Example 🖥️➡️📱
Imagine you want to send a picture from your computer to your friend’s phone. Here’s how networking makes it happen:
Your Computer (Device A) connects to the internet via Wi-Fi.
Your Friend’s Phone (Device B) is also connected to the internet.
Internet: Acts as the bridge between your devices.
Protocol: Like HTTP/HTTPS, ensures the picture is transferred correctly.
Transfer: Your picture travels through the internet and lands on your friend's phone!
Networking in Everyday Life 🌍
Home Network: Connects your phone, laptop, smart TV, and printer.
Office Network: Connects employee computers, shared printers, and the internet.
Public Wi-Fi: Allows you to access the internet in cafes, airports, and parks.
Networking commands
Test network connectivity.
ping google.com
Displays network socket statistics.
netstat
Configures or displays the network interface .
ifconfig
Shows the path that packets take to reach a network host, helping to diagnose routing issues.
traceroute youtube.com
Similar to showing the path to a network host but doesn't require root privileges.
tracepath youtube.com
Combines the functionality of checking reachability and path tracing to continuously update network connection quality and path.
mtr youtube.com
Finds the IP address associated with a domain name (like an internet phone book).
nslookup youtube.com
Connects to remote computers over a network to manage devices and servers.
telnet youtube.com 80 #80 is the port no.
Shows or sets the name of your computer on the network.
hostname
Displays or configures network interface information (IP addresses, routes, etc.).
ip address show
Manages wireless network interface settings (like Wi-Fi).
iwconfig
Displays detailed network socket information (replaces
netstat
).ss
Performs DNS lookups, providing detailed information about domain names.
dig youtube.com
Shows and modifies the ARP table, which maps IP addresses to physical MAC addresses.
arp
Check if network cables are plugged in and active.
ifplugstatus
Note: ip,if and iw represents internet protocol, interface and wireless protocol respectively.
curl
is commonly used to interact with API endpoints. It allows you to send HTTP requests (GET, POST, PUT, DELETE, etc.) to an API and receive responses, which is crucial for testing and working with web services and APIs.curl -x get 'API link' curl -x get 'API link' | jq # jq is the plugin | jq show the api in suitable format in terminal.
wget
is used to download files from the web. It supports HTTP, HTTPS, and FTP protocols.wget 'copied link address' #copy any image from brower and past that link address in the wget command.
iptables
is used to configure the firewall rules on Linux. It helps in managing network traffic and securing your system.sudo iptables -L or sudo iptables --list-rules
watch
runs a command periodically and shows its output, useful for monitoring changes over time.watch top # top command will run after every 2 sec by default. watch -n 5 top # top command will run after every 5 sec.
nmap
is used for network discovery and security auditing. It scans networks to find hosts and services.nmap -v youtube.com
route
displays or modifies the IP routing table. It's used for managing network routes.route -n
Subscribe to my newsletter
Read articles from Kiran Ramakrishna Dunka directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by