IFRENAME(8)
π IFRENAME(8) β Linux Programmer's Manual π
okay bestie, sit down, hydrate, because today we're talking about ifrename β the little tool that gives your network interfaces a consistent name so they stop playing musical chairs on you. Linux Programmer's Manual energy, but make it cute. π
β¨ NAME β¨
ifrename β rename network interfaces based on various static criteria
πΈ SYNOPSIS πΈ
ifrename [-c configfile] [-p] [-d] [-u] [-v] [-V] [-D] [-C]
ifrename [-c configfile] [-i interface] [-n newname]
π¦ DESCRIPTION π¦
Ifrename is a tool allowing you to assign a consistent name to each of your network interface. That's the whole vibe. One interface, one name, forever, no chaos. π
By default, interface names are dynamic, and each network interface is assigned the first available name (eth0, eth1...). And the order network interfaces are created may vary. For built-in interfaces, the kernel boot time enumeration may vary. For removable interface, the user may plug them in any order. So yeah β your eth0 today might be somebody else's eth1 tomorrow. not me finding out my NIC identity is a social construct π
Ifrename allow the user to decide what name a network interface will have. Ifrename can use a variety of selectors to specify how interface names match the network interfaces on the system, and the most common selector is the interface MAC address. (yes bestie, the MAC address, the one thing that doesn't lie π«Ά)
Timing matters!Ifrenamemust be run before interfaces are brought up, which is why it's mostly useful in various scripts (init, hotplug) but is seldom used directly by the user. By default,ifrenamerenames all present system interfaces using mappings defined in/etc/iftab.
π PARAMETERS π
-cconfigfile β Set the configuration file to be used (by default/etc/iftab). The configuration file define the mapping between selectors and interface names, and is described iniftab(5). If configfile is"-", the configuration is read from stdin. π-pβ Probe (load) kernel modules before renaming interfaces. By defaultifrenameonly check interfaces already loaded, and doesn't auto-load the required kernel modules. This option enables smooth integration with system not loading modules before callingifrename.-dβ Enable various Debian specific hacks. Combined with-p, only modules for interfaces specified in/etc/network/interfaceare loaded. Debian girlies, this one's for you π-iinterface β Only rename the specified interface as opposed to all interfaces on the system. The new interface name is printed. β¨-nnewname β When used with-i, specify the new name of the interface. The list of mappings from the configuration file is bypassed, the interface specified with-iis renamed directly to newname. The new name may be a wildcard containing a single'*'. When used without-i, rename interfaces by using only mappings that would rename them to newname. The new name may not be a wildcard.
Heads up: This use ofifrenameis discouraged, because inefficient (-nwithout-i). All the interfaces of the system need to be processed at each invocation, therefore in most case it is not faster than just lettingifrenamerenaming all of them (without both-nand-i). like bestie, why are you making more work for yourself π
-tβ Enable name takeover support. This allow interface name swapping between two or more interfaces. Takeover enable an interface to 'steal' the name of another interface. This works only with kernel 2.6.X and if the other interface is down. Consequently, this is not compatible with Hotplug. The other interface is assigned a random name, but may be renamed later with'ifrename'. The number of takeovers is limited to avoid circular loops, and therefore some complex multi-way name swapping situations may not be fully processed.
Real talk: In any case, name swapping and the use of this feature is discouraged, and you are invited to choose unique and unambiguous names for your interfaces... π
-uβ Enable udev output mode. This enables proper integration ofifrenamein the udev framework,udevd(8)will useifrenameto assign interface names present in/etc/iftab. In this mode the output ofifrenamecan be parsed directly byudevd(8)as anIMPORTaction. This requires udev version 107 or later. π§-Dβ Dry-run mode.Ifrenamewon't change any interface, it will only print new interface name, if applicable, and return. In dry-run mode, interface name wildcards are not resolved. New interface name is printed, even if it is the same as the old name.
Be also aware that some selectors can only be read by root, for example those based on ethtool), and will fail silently if run by a normal user. In other words, dry-run mode under a standard user may not give the expected result. π
-Vβ Verbose mode.Ifrenamewill display internal results of parsing its configuration file and querying the interfaces selectors. Combined with the dry-run option, this is a good way to debug complex configurations or trivial problems. detective mode activated π-Cβ Count matching interfaces. Display the number of interface matched, and return it as the exit status ofifrename. The number of interfaces matched is the number of interface on the system for which a mapping was found in the config file (which is different from the number of interface renamed). don't mix those two up bestie, they are not the same thing π«Ά
π AUTHOR π
Jean Tourrilhes - jt@hpl.hp.com
π FILES π
/etc/iftab
β SEE ALSO β
and that's the whole thing, bestie. go forth and give your interfaces names they deserve. slay. periodt. πβ¨
this page came from the wireless-tools crew, dated 26 February 2007 β vintage but still iconic, no cap. π¦
π¦ where this page comes from
- alpine 3.22: wireless-tools-doc 30_pre9-r5 Β· GPL-2.0-only
- alpine 3.23: wireless-tools-doc 30_pre9-r5 Β· GPL-2.0-only
- alpine 3.24: wireless-tools-doc 30_pre9-r5 Β· GPL-2.0-only
- arch rolling: wireless_tools 30.pre9-5 Β· GPL
- debian bookworm: ifrename 30~pre9-14
- debian trixie: ifrename 30~pre9-18+b1
- nixos 26.05: wireless-tools 30.pre9
- nixpkgs unstable: wireless-tools 30.pre9
- opensuse-leap 16.0: wireless-tools 30.pre9-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: wireless-tools 30.pre9-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: wireless-tools 30.pre9-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: wireless-tools 30.pre9-160000.2.2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms