I have an odd problem that seems simple enough but has evaded me thus far.  I am attempting to support a legacy application that has a hard-coded ethernet device name (eth0).  This hard-coding, I am told, will not change.Now, we are attempting to bring this software in a much more modern OS (Fedora 17) that uses persistent device naming and, as such, has no eth0 interface.  Furthermore, this effort requires that I use the loopback interface for communication to another module as part of a virtualization effort (there is actually a LOT more going on here, but that would take way too long to describe).I am aware that it is possible to create an alias of the form lo:0, however the software is explicitly looking for eth0 and my research and testing thus far has indicated that the iface:N naming scheme is the only one supported.So, in short:Is there any way to create a virtual interface named eth0 that communicates over lo?
Creating an Alias to Loopback Interface with an Arbitrary Name
linux;networking;fedora;ethernet
There may be a simpler way. But if compiling your own kernel is an option, you could create a driver based on the existing loopback driver, change the name (line 193 in that version), and load the module. You'd have a second loopback interface with the name you want.Edit:To be more specific, I mean adding another loopback driver, not replacing the existing one. After copying drivers/net/loopback.c to drivers/net/loopback2.c, apply the following patch (done on top of 3.8):diff --git a/drivers/net/Makefile b/drivers/net/Makefileindex 335db78..cba692f 100644--- a/drivers/net/Makefile+++ b/drivers/net/Makefile@@ -13,7 +13,7 @@ obj-$(CONFIG_MACVLAN) += macvlan.o obj-$(CONFIG_MACVTAP) += macvtap.o obj-$(CONFIG_MII) += mii.o obj-$(CONFIG_MDIO) += mdio.o-obj-$(CONFIG_NET) += Space.o loopback.o+obj-$(CONFIG_NET) += Space.o loopback.o loopback2.o obj-$(CONFIG_NETCONSOLE) += netconsole.o obj-$(CONFIG_PHYLIB) += phy/ obj-$(CONFIG_RIONET) += rionet.odiff --git a/include/linux/netdevice.h b/include/linux/netdevice.hindex 9ef07d0..ed9d82d 100644--- a/include/linux/netdevice.h+++ b/include/linux/netdevice.h@@ -2718,6 +2718,7 @@ static inline bool netif_supports_nofcs(struct net_device *dev) } extern struct pernet_operations __net_initdata loopback_net_ops;+extern struct pernet_operations __net_initdata loopback2_net_ops; /* Logging, debugging and troubleshooting/diagnostic helpers. */diff --git a/net/core/dev.c b/net/core/dev.cindex f64e439..7c1cffb 100644--- a/net/core/dev.c+++ b/net/core/dev.c@@ -6834,6 +6834,9 @@ static int __init net_dev_init(void)        if (register_pernet_device(&loopback_net_ops))                goto out;+       if (register_pernet_device(&loopback2_net_ops))+               goto out;+        if (register_pernet_device(&default_device_ops))                goto out;I'm realizing that simply loading the module won't be sufficient, as this modifies code in net/core/dev.c. You'll also have the install the patched kernel.