EP1: Networking in Linux - IP command
In Linux, almost everything about networking, interfaces, IP addresses, routing, and even the ARP cache, can be controlled from the terminal. For many years, tools like ifconfig, route, and arp handled these tasks, but those commands have long been deprecated. Their modern replacement is the ip command.
ip is part of the iproute2 suite, included by default in all modern Linux distributions. It’s a powerful all-in-one tool for managing network interfaces, IP addresses, routes, and neighbor tables, replacing older utilities like ifconfig, route, and arp.
You’ll use it to bring interfaces up or down, assign addresses, inspect routes, create network namespaces and even manipulate neighbor (ARP) tables.
In this episode, we’ll focus on using the ip command to manage network interfaces, addresses, routes, and connections on a Linux system.
Peeking Inside the ip Command
Before we start experimenting, let’s look at how the ip command is structured.
ip [ OPTIONS ] OBJECT { COMMAND | help }At first glance, this may look dense, but it’s actually straightforward once you understand the pattern. The structure is always:
Options – Extra flags that change how
ipbehaves globally.Object – What part of the network you’re interacting with.
Each object represents a kernel networking subsystem. Some common ones are:
link– network interfaces (Ethernet, Wi-Fi, loopback)address– IPv4 or IPv6 addresses on those interfacesroute– entries in the routing tableneighbor– ARP or NDP neighbor cachemaddress– multicast membershipsrule– routing policy database
TIP
You can use short forms too: addr for address, r for route, l for link, and so on.
Command – The action you want to take on that object.
Each object supports its own set of commands:
showorlist– display informationadd– create a new entry (address, route, etc.)del– remove an entryreplace– update an existing onehelp– display valid options and syntax
Managing Network Interfaces
Every network device in Linux, whether wired, wireless, or virtual, is represented by an interface. These interfaces are managed through the link object of the ip command.
When you use ip link, you’re listing and controlling the network interfaces recognized by the system.
Let’s start exploring.
Viewing All Interfaces
To see all interfaces currently recognized by your system, run:
ip link showYou’ll get output similar to:
Let’s decode that quickly:
The number (
1:,2:) is the interface index.loandenp0s3, enp0s8are interface names.Flags inside
< >describe capabilities and state (UP,BROADCAST,MULTICAST, etc.).mtuis the maximum transmission unit, the largest packet size the interface can handle.link/ethershows the MAC address (hardware address).The
statetells whether the interface is currently up (active) or down.
NOTE
lois the loopback interface, a virtual interface the system uses to talk to itself. It’s always present and usually stays up.
Sysxplore is an indie, reader-supported publication.
I break down complex technical concepts in a straightforward way, making them easy to grasp. A lot of research goes into every piece to ensure the information you read is as accurate and practical as possible.
To support my work, consider becoming a free or paid subscriber and join the growing community of tech professionals.
Bringing an Interface Down
If you want to temporarily disable a network interface, use:
$ sudo ip link set dev enp0s8 downThis shuts down packet transmission and reception on enp0s8 (notice the state is DOWN). It’s useful when testing configurations or disabling a specific connection without unplugging cables or removing devices.
After running it, the interface will no longer appear in ip route show outputs because it’s considered inactive by the kernel. The routing table only displays routes from active interfaces.
Bringing an Interface Up
When you bring an interface up, you’re telling the system that the device should start transmitting and receiving packets.
$ sudo ip link set dev enp0s8 upThis sends a netlink request that transitions the enp0s8 interface to an UP state.
You can verify it:
$ ip -c link show enp0s8You should now see the UP flag and state UP in the output.
And also notice, the interface route is now showing in the routing table.
Renaming Interfaces
Linux lets you rename interfaces, which can be useful for creating clear and predictable names when working with multiple network connections or during troubleshooting.
Keep reading with a 7-day free trial
Subscribe to sysxplore to keep reading this post and get 7 days of free access to the full post archives.




