Linux commands
Network
Addresses and names
| Command |
Shows |
ip -brief address |
Each network card, UP/DOWN, and its address |
hostname -I |
Just the addresses |
ip route |
Your home network range and the router (default via ...) |
ip -4 route show scope link |
Your home network range only, e.g. 192.168.1.0/24 |
hostname |
The server's name |
getent hosts debian.org |
Test that names can be looked up (DNS) |
tailscale ip -4 |
The server's Tailscale address (100.…) |
tailscale status |
All your Tailscale devices and whether they're online |
Network card names: wl… = Wi-Fi, en…/eth… = cable, tailscale0 = Tailscale, lo = the computer itself.
Test a connection
| Command |
Tests |
ping -c 3 1.1.1.1 |
Is the internet reachable? (no names involved) |
ping -c 3 debian.org |
Internet and names |
ping -c 3 homeserver.local |
From your Mac: can I see the server? |
curl -I https://debian.org |
Can I open a website? |
curl -s http://127.0.0.1:8095/health |
Is a local service answering? |
nc -vz homeserver.local 22 |
From your Mac: is port 22 reachable? (-G 5 on Mac to give up after 5 s) |
What's listening
| Column |
Meaning |
Local Address:Port |
Where it listens: 127.0.0.1 = this computer only, 0.0.0.0/[::] = all networks |
Process |
Which program |
Find one port: sudo ss -lntp | grep 8095.
Firewall (UFW)
| Command |
Does |
sudo ufw status verbose |
On/off, default policy, all rules |
sudo ufw status numbered |
Rules with numbers (for deleting) |
sudo ufw allow from 192.168.1.0/24 to any port 22 proto tcp |
Allow a port from your home network only |
sudo ufw allow in on tailscale0 to any port 22 proto tcp |
Allow a port over Tailscale only |
sudo ufw delete 3 |
Delete rule number 3 (numbers change afterwards) |
sudo ufw reload |
Re-read the rules |
sudo nft list table inet aiguard |
The AI network guard and its block counter |
Wi-Fi
| Command |
Does |
sudo ifup wlp2s0 |
Start the Wi-Fi card |
sudo ifdown wlp2s0 |
Stop it (not over SSH via Wi-Fi! You'd cut yourself off) |
sudo journalctl -b -u networking |
Why the network didn't start |
cat /etc/network/interfaces |
Network settings (the Wi-Fi password may be in here, so don't share the output) |