Renaming an interface with ip link set … name … is useful when a temporary network device needs a clearer runtime label for testing, troubleshooting, or short-lived lab automation. The command is most often used on dummy, VLAN, veth, or tunnel interfaces where a descriptive name is more useful than the default one.
The ip link set dev OLDNAME name NEWNAME syntax changes the kernel-visible interface name immediately. Current ip-link(8) behavior still supports that direct rename flow, but keeping the interface down during the change avoids renaming a running device and keeps the result easier to verify.
The rename affects the running system, not the host's persistent naming policy. A reboot, declarative network config, or another naming rule can restore a different name later. Renaming the wrong interface can also break routes, firewall matches, and remote access, so the target device should be confirmed before the change.
Steps to rename an interface with ip link:
- Confirm the current interface name and note its current state before changing it.
$ ip link show dev dummy0 12: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 1e:36:04:73:34:56 brd ff:ff:ff:ff:ff:ff - Bring the interface down before renaming it.
$ sudo ip link set dev dummy0 down
Current ip-link(8) guidance does not recommend renaming a running interface or one that already has addresses configured.
- Rename the interface to the new runtime name.
$ sudo ip link set dev dummy0 name lab0
Renaming the active management interface on a remote host can break SSH sessions, routes, or firewall rules that still match the old device name.
- Bring the renamed interface back up when it should return to service.
$ sudo ip link set dev lab0 up
Skip this step if the interface should remain administratively down after the rename.
- Verify the new interface name and resulting state.
$ ip link show dev lab0 12: lab0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/ether 1e:36:04:73:34:56 brd ff:ff:ff:ff:ff:ffThe old name should no longer resolve once the rename succeeds.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
