How to Manage Network Interfaces with the Linux ip Command
The ip command shows and configures network interfaces. ip addr prints your IP addresses, and ip link lists your network devices. It replaced the old ifconfig and is the first stop for any network question.
Show your IP addresses with ip addr
ip addr (or the short form ip a) lists every interface with its IPv4 and IPv6 addresses. Look for your main interface, typically eth0, enp0s3 or wlan0.
List interfaces with ip link
To see just the interface names and their state (up or down), use ip link. An interface in state DOWN is not connected.
Show routes with ip route
ip route shows your routing table: the default gateway, which is the route marked default, and local subnets.
Bring an interface up or down
Admin commands need root. Bring an interface up or down with ip link set:
ip vs ifconfig
The older ifconfig is deprecated and often missing on modern systems. ip does everything ifconfig did and more. See ip for the full command set, and test a host with ping.
Keep learning
Related guides: How to Test Network Connectivity with ping · How to Check Open Ports with ss and netstat · How to Query DNS with dig and nslookup. Read all tutorials on the Learn Linux blog.