Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)

share|improve this question

4 Answers 4

up vote 13 down vote accepted

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.

share|improve this answer
1  
Right on! Exactly the solution I was hoping for, thank you so much :) It works like a dream. –  Time Sheep Aug 15 '13 at 11:53
    
I have a problem. When trying to change the MAC with ip link set dev eth0 address 01:23:45:67:89:ab (While the adapter is down of course) it says RTNETLINK answers: Cannot assign requested address. I also tried installing macchanger, but it returns a similar error. Everything tried as root. –  Time Sheep Sep 9 '13 at 20:29
1  
@TimeSheep That's not a valid MAC address. In particular, that's a multicast address. Try 00:23:45:67:89:ab. That'll work. But 02:23:45:67:89:ab would be better. See, e.g., en.wikipedia.org/wiki/MAC_address#Address_details –  derobert Sep 9 '13 at 21:11
    
Ah, thanks. I completely forgot that there are requirements for those things to work. I'll just grab the next one it randomly generates and use that. Is there a way to keep the device persistent across reboots rather than recreating it and setting its address back on boot with a script? –  Time Sheep Sep 11 '13 at 18:53
    
@TimeSheep Not really. Its a virtual interface, it doesn't exist anywhere but the kernel's mind... so when you reboot, its gone. –  derobert Sep 11 '13 at 19:34

You can also set udev rules to give your network cards the names you want:

https://wiki.archlinux.org/index.php/Network_Configuration#Change_device_name

Of course, you should NOT tell udev to call them eth0, eth1, etc. What does Maple do if you only have a wifi card?

share|improve this answer
    
I don't know about Maple, but I have seen other “copy-protected” software that checks your MAC and only looks at network interfaces called eth0 and eth1. If yours is called wlan0, too bad (unless you know how to rename it or create a virtual interface). –  Gilles Aug 14 '13 at 21:50
    
If you only have a wifi card I just think you'd be out of luck. I talked with a rep about it, but they don't seem to be the ones writing the licensing system. I did tell them that the naming conventions are most likely changing and that they should look into patching the whole thing for better support. you are correct in your suspicions of the cause of the problem with the activation, particularly the issue with the Ethernet adapter name. Unfortunately, it is a limitation of the licensing software that it has to look for an "eth0" in order to find the Host ID of the system –  Time Sheep Aug 15 '13 at 9:00
    
Any chance you could use udev rules to temporarily rename your NIC to eth0, then remove that rule and reboot after activation? I don't actually know whether it's always really, really bad to rename your card ethX, or just sometimes. –  rainbowgoblin Aug 15 '13 at 10:53
    
@rainbowgoblin No, it checks with the server every time it's started up, so it would just start giving me the "Couldn't get host ID" error again later. Either way derobert's solution was perfect, and doesn't even feel like that much of a workaround. –  Time Sheep Aug 15 '13 at 11:54

Simplest solution - though this only works on systems with one ethernet card:

ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

Arch Linux uses "predictable naming." This turns that off.

share|improve this answer
    
I already tried that, it just messed it all up and my adapters vanished. –  Time Sheep Sep 6 '13 at 12:51

I'm looking at a very similar issue with a computer with no wired network card at all. This solution looks like a good one: http://jms.id.au/wiki/FakeEth0

Basically, the idea is to create/modify a few files to create a dummy interface:

In /etc/modules-load.d/dummy, add:

# load dummy interface module
dummy

In /etc/udev/rules.d/70-persistent-net.rules, add:

SUBSYSTEM=="net", KERNEL=="dummy0", NAME="eth0"

Then in /etc/network/interfaces, add:

iface eth0 inet static
    hwaddress DE:AD:BE:EF:CA:FE

You should be able to do a modprobe dummy at this point and check to make sure the interface was set up correctly. It may not set the mac address if you use modprobe instead of rebooting; in that case do ip link set dev eth0 address de:ad:be:ef:ca:fe.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.