IP Addresses
"What's this server's IP?" - A question you'll answer many times. Let's learn how.
ip addr - Modern Way
Or shorter: ip a
Reading the Output
| Field | Meaning |
|---|---|
lo | Loopback interface (localhost) |
eth0 | First Ethernet interface |
inet 192.168.1.100/24 | IPv4 address with subnet |
brd | Broadcast address |
scope global | Reachable from anywhere |
Interface Names
Modern systems use predictable names:
enp0s3- Ethernetwlp2s0- Wirelesseth0,wlan0- Traditional names (still common in VMs)
ifconfig - Legacy Way
ifconfig is deprecated but still widely used. ip is the modern replacement.
Just the IP Address
hostname -I is the quick way.
IPv4 vs IPv6
Network Interfaces
List Interfaces
Check If Interface Is Up
UP and LOWER_UP mean it's active and cable is connected.
Public vs Private IPs
Private IP ranges (not routable on internet):
10.0.0.0/8172.16.0.0/12192.168.0.0/16
Which command shows network interfaces on a modern Linux system?
Quick Reference
| Command | Shows |
|---|---|
ip addr or ip a | All IP addresses |
ip -4 addr | IPv4 only |
hostname -I | Quick IP list |
ip link show | Interface status |
curl ifconfig.me | Public IP |
Key Takeaways
ip addrshows IP addresses (modern)ifconfigstill works but is deprecatedhostname -Iis the quick way to get IPs- Private IPs (192.168.x.x) aren't internet-routable
- Check interface status with
ip link show
Next: testing connectivity with ping.