Checking Your Network Basics – The Warrior’s Digital Map
Ah, young warrior! 🥷
Before launching an attack (or fixing your Wi-Fi 😅), you must first know your own network. A skilled Linux ninja never walks into battle blind – they scan, analyze, and understand the digital terrain.
Today, we train in network reconnaissance – the art of knowing where you stand before moving forward! 🎯
Finding Your Own IP – Who Am I?
Every warrior must know their identity in the digital world. To see your IP address, use:
Command | What It Does |
---|---|
ip a | 📜 Shows all IP addresses |
hostname -I | 🎯 Shows your local IP only |
curl ifconfig.me | 🌍 Shows your public IP (requires internet) |
💡 Example:
ip a # Displays all network interfaces
hostname -I # Only shows your local IP
Now you know where you are in the network dojo! 🏯
Checking Your Network Interfaces – The Hidden Paths
Every device has interfaces – different ways to connect to the digital world. Check them using:
Command | What It Does |
---|---|
ip link show | 🔗 Shows all network interfaces |
ifconfig | 🖥 Displays interface details (Old-school) |
iwconfig | 📡 Shows Wi-Fi details |
💡 Example:
ip link show # Shows Ethernet, Wi-Fi, and virtual interfaces
iwconfig # Checks Wi-Fi details (SSID, signal strength)
This is how you know your weapons before battle! ⚔
Checking Open Connections – Who’s Talking to Me?
Want to see who’s connected to your machine? These commands reveal the hidden connections:
Command | What It Does |
---|---|
netstat -tulnp | 📡 Lists open ports & connections |
ss -tulnp | 🚀 Faster, modern version of netstat |
lsof -i | 🧐 Shows which programs are using the network |
💡 Example:
netstat -tulnp # Lists active ports
ss -tulnp # Faster version
lsof -i # Shows which program is using which port
If you find suspicious connections, a hacker may already be inside your system! 😱
Checking Your Gateway & DNS – The Master’s Secrets
A ninja must know who they depend on. Find out your router (gateway) & DNS servers:
Command | What It Does |
---|---|
ip route show | 🛤 Shows default gateway (router) |
nmcli dev show | grep 'DNS'` |
🌍 Finds your DNS servers
💡 Example:
ip route show # Shows your default gateway (router IP)
nmcli dev show | grep 'DNS' # Finds your DNS servers
Knowing these helps you troubleshoot internet issues like a pro! 🏆