📄 ifrename-vs-xxx.txt
字号:
Network interface renaming comparison -------------------------------------INTRODUCTION------------ The Wireless Tools package includes 'ifrename', a tool torename network interfaces. However, this is not the only solution tothe problem of renaming network interfaces. This document explain thedifferences between ifrename and the various alternatives. The subject of interface renaming may look simple at firstglance, and is simple in 95% of the cases, however there are manycomplex scenario and those tools have many features, which explain whywe need to go in more details than just saying 'tool X is better'.NAMEIF------ The tool 'nameif' was designed to rename networkinterfaces. It either loads mapping from the file /etc/mactab oraccept mapping on the command line. It is part of the net-tools package : http://www.tazenda.demon.co.uk/phil/net-tools/ Advantages over 'ifrename' : + More widespread, available in very old distributions + simpler/smaller Drawbacks compared to 'ifrename' : - Only support MAC address selector - Does not support hotplug invocation - Does not support module on-demand loading Comments : o The fact that nameif does not support selector otherthan the MAC address is problematic, as USB-NET devices may not haveMAC addresses and some ethernet/wireless drivers can't query the MACaddress before 'ifconfig up'. o 'ifrename' was designed as a better 'nameif', andits concept is very similar.IPROUTE------- The tool 'ip' can rename network interfaces with the followingsyntax : > ip link set <oldname> name <newname> It is part of the 'iproute' package : http://developer.osdl.org/dev/iproute2/ Advantages over 'ifrename' : + integrated in 'iproute', which most people need anyway Drawbacks compared to 'ifrename' : - Do not support any selector, must use old interface name - No 'batch' mode, must rename each interface manually Comments : o 'ip' only provide the most basic facility. To use itautomatically, like in init/hotplug scripts, wrappers adding somerules/selector must be written.DRIVER MODULE PARAMETERS------------------------ Some network driver have module parameters enabling to specifythe network name of all the devices created by the driver. This isdriver specific, so you will need to check your driver. Advantages over 'ifrename' : + very simple to get configured and running Drawbacks compared to 'ifrename' : - Not universally supported : few drivers do it - Fragmented : each driver does it differently - The only selector available is the driver Comments : o This method was never popular with the kernelpeople, and this feature is being removed from driver that use toinclude it.UDEV---- The package 'udev' include facility to rename networkinterfaces, with rules such as : KERNEL="eth*", SYSFS{address}="00:52:8b:d5:04:48", NAME="lan" This is part of the udev package : http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html Advantages over 'ifrename' : + integrated into 'udev' + simpler to setup if 'udev' is already properly setup Drawbacks compared to 'ifrename' : - Less selectors that 'ifrename' - Require kernel 2.6.X or later with sysfs support - Do no support non-hotplug interfaces - Require 'udev', not everybody uses it (static /dev, devfs) - Does not support module on-demand loading Comments : o 'udev' support many selectors, basically all thosepresent in 'sysfs', even if the documentation only show instructionsto use the MAC address (which is problematic with virtual devices somedrivers - see above). 'ifrename' can also use all selectors present in'sysfs' (like 'udev'), plus some other selectors not present in sysfsthat were found to be useful. o Not all interfaces are managed by hotplug. Allvirtual devices, such as tunnels and loopbacks, are not associatedwith a hardware bus, and therefore are not managed by hotplug. Alldriver compiled statically into the kernel are not managed byhotplug. 'udev' can't deal with those devices. o It is common practice on embedded system to use astatic /dev and not 'udev' to save space and boot time. And to not usehotplug for the same reasons. o 'ifrename' could be better integrated in 'udev', I don't foresee any technical issues.SELECTOR AWARE NETWORK SCRIPTS------------------------------ Another method is to not rename the interface at all, and makethe various network script selector aware. The basic idea is to simplyignore the interface name and have all the network scripts based onselectors. The main example is the original Pcmcia network scripts. Theyallow you to configure an interface directly based on MAC address andPcmcia socket. Another example is the script get-mac-address.sh usedas a mapping in some Debian configuration. On the other hand, Red-Hatand Fedora scripts don't apply, as they wrap around 'nameif'. Advantages over 'ifrename' : + usually simpler to setup and understand Drawbacks compared to 'ifrename' : - Less selectors that 'ifrename' - Only work for the scripts, other tools left confused Comments : o This method is conceptually simpler, and workswell. It eliminates the two steps process of other methods (renaming ;configuring). o Unfortunately, this method only apply to thespecific scripts, and not to the majority of the networking toolswhich are still based on interface name. This means that when the useruse those other tools, he is left guessing which interface is which. o Distributions never never really embraced thismethod, as they all replaced the original Pcmcia scripts with oneusing the interfacename. Have fun... Jean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -