~2 min read • Updated Jul 20, 2025

1. What Is an IP Address?


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.

  • IPv4: Four numerical segments (e.g., 192.168.1.1)
  • IPv6: Eight hexadecimal blocks designed to expand the address pool

2. What Is the ip Command?


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

3. Installing ifconfig (Legacy Tool)


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

4. ip vs ifconfig Comparison


Featureifconfigip
Show IP address
ifconfig
ip addr
Modern & extensible
Interface control
ifconfig eth0 down
ip link set eth0 down
View routing table
route -n
ip route

5. Useful ip Subcommands


  • View all addresses:
    ip addr show
  • IPv4 only:
    ip -4 addr show
  • IPv6 only:
    ip -6 addr show
  • Show routes:
    ip route show
  • Display network interfaces:
    ip link show

6. Check IP with hostname Command


Quickly show current IP(s):

hostname -I

7. Temporarily Assign an IP Address


Manually assign IPv4 address to eth0:

sudo ip addr add 192.168.1.10/24 dev eth0
sudo ip link set eth0 up

8. Security and Usage Notes


  • Private IPs (e.g., 192.168.x.x) are for local networks
  • Public IPs require careful firewall and NAT configuration
  • DHCP and VPN settings affect routing and IP assignment

9. Conclusion


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.


Written & researched by Dr. Shahin Siami