The ip command is the standard network configuration tool on modern Linux systems. It is part of the iproute2 package, installed by default on virtually every distribution.
ip covers interface management, IP address assignment, routing, and ARP table operations in a single unified tool — replacing the older ifconfig and route commands from the deprecated net-tools package.
Important: all changes made with ip apply to the running kernel state only. A reboot resets everything. To persist changes, configure your distribution’s network manager: systemd-networkd, NetworkManager, or the distro-specific interface configuration files.
The syntax is:
baship [OPTIONS] OBJECT { COMMAND | help } Four objects cover most networking tasks:
| Object | Short form | Purpose |
|---|---|---|
link | l | Network interfaces |
address | a | IP addresses |
route | r | Routing table |
neigh | n | ARP neighbor table |
Objects can be written in full or abbreviated form: ip a and ip addr are identical. For help on any object, run ip OBJECT help.
Read operations work without elevated privileges. Modifications require sudo. A failed modification returns RTNETLINK answers: Operation not permitted.
The addr object manages IP addresses. Always include the CIDR prefix length:
baship addr show # all interfaces and their IP addressesip addr show dev eth0 # one interface onlyip -4 addr show # IPv4 onlyip -6 addr show # IPv6 only
ip link show returns only layer-2 information — MAC address, state, and MTU — with no IP address data. Use ip addr show when you need both.
Assign an IP address:
bashsudo ip addr add 192.168.121.45/24 dev eth0
On success, no output is produced. If the interface does not exist, you get “Cannot find device eth0”. Modern systems often use names like ens3, enp2s0, or wlan0 rather than eth0.
You can assign multiple addresses to the same interface. The second address onward is marked as secondary in the output.
Remove an IP address:
bashsudo ip addr del 192.168.121.45/24 dev eth0
Bring an interface up or down:
bashsudo ip link set eth0 upsudo ip link set eth0 down
View packet and error statistics with the -s flag:
baship -s link show dev eth0
The output includes RX and TX counters for bytes, packets, errors, and dropped frames.
Routing table operations:
baship route list # show all routesip route add 192.168.121.0/24 via 192.168.121.1 # add via gatewayip route add 192.168.121.0/24 dev eth0 # add via deviceip route add default via 192.168.121.1 dev eth0 # add default routeip route del default # delete default routeip route del 192.168.121.0/24 via 192.168.121.1 # delete specific route
If a route already exists for that destination, adding a new one fails with “RTNETLINK answers: File exists”. Delete the existing route first, then re-add.
ARP table operations. The neigh object maps IP addresses to MAC addresses on the local network:
baship neigh show # display ARP tablesudo ip neigh add 192.168.121.50 lladdr 00:11:22:33:44:55 dev eth0 # static ARP entrysudo ip neigh del 192.168.121.50 dev eth0 # remove entrysudo ip neigh flush dev eth0 # flush all entries
In ip neigh show output, REACHABLE means the MAC address was recently confirmed. STALE means the entry exists but has not been verified recently and may no longer be accurate.
Use ip addr for IP addresses, ip link for interface state and statistics, ip route for routing, and ip neigh for the ARP table. All changes are runtime-only — persist them through your network manager after verifying they work. Leave a comment below if you run into any issues.
The type command in Linux shows how the current shell would interpret a name typed on the…
When a Linux system is slow or behaving unexpectedly, memory is one of the first…
Every file and directory in Linux has an owner (a user) and a group. Together…
The command line does not have a Trash folder. When you delete a file from…
Systemd is the init system on most modern Linux distributions. A service file (also called…
Linux is a multi-user system. Each person or service that needs access should have its…