How to Create a Virtual Ethernet Interface Named eth0

iproutelinux-kernelnetworking

I am running Arch based on the Linux 3.10.5-1 kernel. The system uses the new de-facto naming conventions of ethernet interfaces enp*s* and wlp* etc. This is a problem however, as my educational institution is using a program called Maple 17. Maple's licensing system is dependant on the existence of an interface named eth0 because it must retrieve the MAC address of it to verify the license. It's a bad solution, but I have to work around it.

This means I will need an eth0 interface with any MAC address at all (As I can retrieve a new license file for the new MAC address) that doesn't necessarily have to work. In fact, it should just be down at all times. I reckon there are several ways to attempt to solve this issue, but I haven't been able to find anything about any of the ideas.

  • Creating an adapter without connectivity
  • Creating an alias for enp3s0 named eth0
  • Renaming enp3s0 or the loopback interface.

The things I was able to find only covered changing to the newer conventions and on older versions of udev. They only worked on RHEL and SuSe anyway. I tried it without luck though. (persistent-net-names.rules and net-name-slot.rules, both of them just made my actual interface stop working and my wlan interface disappear)

Best Answer

Sure. You can create a tap device fairly easily, either with tunctl (from uml-utilities, at least on Debian):

# tunctl -t eth0
Set 'eth0' persistent and owned by uid 0
# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr a6:9b:fe:d8:d9:5e  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Or with ip:

# ip tuntap add dev eth0 mode tap
# ip link ls dev eth0
7: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 500
    link/ether 0e:55:9b:6f:57:6c brd ff:ff:ff:ff:ff:ff

Probably you should prefer the second method, as ip is preferred network tool on Linux, and you likely already have it installed.

Also, both of these are creating the tap device with a—I'd guess—random local MAC, you can set the MAC to a fixed value in any of the normal ways.

Related Question