Networking Fu – Mastering the Art of Connection
In the ancient scrolls of Linux, there exists a powerful discipline known as Networking Fu. If you wish to traverse the web like a ghost, troubleshoot like a hacker, and command the internet like a sorcerer, you must first learn the fundamental networking commands.
Checking Your Own Identity
Before hacking into the matrix, let’s find out who we are:
What's My IP?
ip a
or the classic:
ifconfig # (Install it first: sudo apt install net-tools)
Output:
inet 192.168.1.42
This is your local IP address.
Want to know your public IP?
curl ifconfig.me
Now you know how hackers find their own footprints. 🕵️
Checking Your Connection to the Outside World
Can You Reach the Internet?
ping google.com
This command sends small packets to check if Google is responding. If you see replies, your internet is working.
Need a faster test?
curl -Is https://google.com | head -1
It should return:
HTTP/2 301
which means Google is alive! 🎉
Finding Out Where the Network Breaks
Tracing the Path to a Website
Ever wondered how your request reaches Google? Use:
traceroute google.com
or
mtr google.com # (More advanced. Install it with: sudo apt install mtr)
You’ll see a list of all network hops between you and Google. If it stops somewhere, that’s where the problem is!
Finding Open Ports – The Gateways to a System
Who’s Listening?
netstat -tulnp # Shows all open ports
or
ss -tulnp # (Better alternative)
Output:
Proto Local Address Foreign Address State PID/Program
tcp 0.0.0.0:22 0.0.0.0:* LISTEN 1234/sshd
tcp 0.0.0.0:80 0.0.0.0:* LISTEN 5678/nginx
This means your server is running SSH (port 22) and a web server (port 80). If a port is open, someone can connect to it. 🕵️
Want to scan another machine’s open ports?
nmap -sS target-ip
(Install with: sudo apt install nmap
)
Controlling the Network – Becoming the Master
Disconnect a Rogue User (Wi-Fi Prank)
Want to disconnect a device from your network? First, find its MAC address:
arp -a
Then, send de-authentication packets (evil laugh 😈):
aireplay-ng -0 1 -a ROUTER_MAC -c TARGET_MAC wlan0
(Use responsibly! You don’t want the Wi-Fi police after you. 🚔)
BONUS: Fake Your IP
Want to change your MAC address and go incognito mode?
sudo ifconfig wlan0 down
sudo macchanger -r wlan0
sudo ifconfig wlan0 up
(Install with: sudo apt install macchanger
)
🏆 Your Training Task
1️⃣ Find your local IP address.
2️⃣ Find your public IP.
3️⃣ Use traceroute
to see how your request travels.
4️⃣ List all open ports on your system.
5️⃣ Scan your own machine with nmap 127.0.0.1
.
6️⃣ Bonus: Change your MAC address and test if your network still works.
Next lesson: Shell Scripting – Automate Everything Like a Cyber Samurai! 🎭