IP Command - Network Management
The ip command is a powerful utility in Linux for managing network interfaces, IP addresses, routing tables, and tunnels. It is the modern replacement for the older ifconfig and route commands.
IP Address Management
This section covers commands for displaying and manipulating IP addresses on your network interfaces.
# ip addr show
# Display the current IP addresses and network interfaces
# ip addr add 192.168.1.100/24 dev eth0
# Add a new IP address to an interface
# ip addr del 192.168.1.100/24 dev eth0
# Delete an IP address from an interface
# ip addr flush dev eth0
# Flush all IP addresses on an interface
# ip -brief addr show
# Shortcut: Show brief information about IP addresses and devices
Routing Table Operations
Manage your system's routing table to control how network traffic is directed.
# ip route show
# Display the routing table
# ip route add default via 192.168.1.1
# Add a new default gateway
# ip route del default
# Delete the default gateway
Network Interface Configuration
Control the state and properties of your network interfaces.
# ip link set dev eth0 up
# Bring an interface up
# ip link set dev eth0 down
# Bring an interface down
# ip link show
# Show network interfaces and link status
# ip link set dev eth0 address 00:11:22:33:44:55
# Change the MAC address of an interface
# ip -brief link show
# Shortcut: Show brief information about link status
Tunnel Management
Configure and view network tunnels.
# ip tunnel show
# Show information about tunnels