An IP (Internet Protocol) address uniquely identifies a device on a network. In Linux, IP addresses are used for internet access, local communication, and configuring services.
ip
is the modern replacement for ifconfig
, used for inspecting and manipulating network interfaces, IP addresses, routes, and device status.
ip addr
ip link
ip route
ifconfig
is part of the deprecated net-tools
package. To install:
sudo apt install net-tools # Debian / Ubuntu
sudo yum install net-tools # CentOS / RHEL
Feature | ifconfig | ip |
---|---|---|
Show IP address |
|
|
Modern & extensible | ❌ | ✅ |
Interface control |
|
|
View routing table |
|
|
ip addr show
ip -4 addr show
ip -6 addr show
ip route show
ip link show
Quickly show current IP(s):
hostname -I
Manually assign IPv4 address to eth0:
sudo ip addr add 192.168.1.10/24 dev eth0
sudo ip link set eth0 up
Mastering IP configuration and the ip
command in Linux is foundational for networking. Whether viewing interfaces, configuring addresses, or inspecting routing behavior, these tools help users maintain control over system connectivity in both local and enterprise environments.