The ip command on Ubuntu (and modern Linux generally) replaces the older ifconfig and route commands. ip addr shows/manages IP addresses, ip route shows/manages routes, ip link shows/manages interfaces. ip -br gives compact output for scripts. The team that learns ip has a single tool for all networking.
Table of contents
- ip addr: show and set IPs
- ip route: show and set routes
- ip link: show and set interfaces
- ip neigh: ARP/ND table
- Useful one-liners
- FAQ
ip addr: show and set IPs
Show all addresses:
ip addr show
# or shorter
ip a
Compact output:
ip -br addr show
# Output: lo UNKNOWN 127.0.0.1/8 ::1/128
# eth0 UP 192.0.2.10/24 fe80::1/64
Add an IP:
sudo ip addr add 192.0.2.20/24 dev eth0
Remove an IP:
sudo ip addr del 192.0.2.20/24 dev eth0
The team that uses ip -br addr in scripts has clean output to parse.
ip route: show and set routes
Show routing table:
ip route show
# or
ip r
Add default route:
sudo ip route add default via 192.0.2.1
Add specific route:
sudo ip route add 10.0.0.0/8 via 192.0.2.1 dev eth0
Delete a route:
sudo ip route del 10.0.0.0/8
The team that uses ip route get <dest> to debug routing finds the actual path packets take.
ip link: show and set interfaces
Show all interfaces:
ip link show
# or
ip l
Bring interface up/down:
sudo ip link set eth0 up
sudo ip link set eth0 down
Change MTU:
sudo ip link set eth0 mtu 9000
The team that uses ip link set eth0 up/down to reset an interface after config changes has the right pattern.
ip neigh: ARP/ND table
Show the neighbor table (ARP for IPv4, ND for IPv6):
ip neigh show
Useful for debugging ‘is this host even on the network’ questions. The team that sees the expected MAC address has connectivity; the team that sees incomplete or no entry has a Layer 2 problem.
Useful one-liners
# Default gateway
ip route | grep default
# All IPs on this host
ip -j addr show | jq -r '.[].addr_info[].local'
# All listening ports
ss -tlnp
# Specific interface details
ip -d link show eth0
# All routes
ip route show table all
The team that uses these one-liners has fast answers to common questions.
FAQ
Where did ifconfig go?
Deprecated in favor of ip. Modern Ubuntu (18.04+) ships with iproute2 (which provides ip) and may not have ifconfig. The team that needs ifconfig installs net-tools, but ip is the right answer.
What’s the difference between ip and ip command?
Same thing - ip is the command, iproute2 is the package. The team that installs iproute2 gets ip.
How do I get my public IP?
From inside the host: curl -4 ifconfig.me or curl https://api.ipify.org. From outside: just look at your router or use a service like whatismyip.com.
Can I use ip to set up an entire network?
Yes - ip can set addresses, routes, vlan interfaces, bridges, bonds, tunnels, and more. The team that does serious network configuration uses ip + NetworkManager/Netplan/systemd-networkd for persistence.
How do I see TCP connections?
ss -tan (replace ifconfig’s old netstat). The team that uses ss has faster, more complete info than netstat.
If you are sizing the infrastructure for the kind of project this post covers, the RunxBuild hosting calculator is the right place to model the line items. The compute, the memory, the storage, the bandwidth, the database - each one is a separate number, and the team’s mental model for the platform is the sum of those numbers. The RunxBuild dashboard is where the team sees the actual usage in one place.
Useful related references: