# Making a ghost eth0

## Wormer

I have some commercial software with some broken DRM crapware that demands that there be an "eth0" in order for it to work. Of course, with persistent naming my network device is instead named something like "ens33". How can I make references to "eth0" refer to "ens33" so that this stupid software is satisfied? 

Obviously I could turn off persistent naming and just have it be called eth0 in the first place. I'd rather not change the naming convention of the entire system to satisfy one broken piece of software.

If worst comes to worst, what's the recommended way to have the network interface referred to as "eth0" in the first place? I'm using systemd and it doesn't look like there is actually a /etc/udev/rules.d/80-net-setup-link.rules.

----------

## Buffoon

Not sure about systemd, otherwise one could create an alias.

----------

## Wormer

 *Buffoon wrote:*   

> Not sure about systemd, otherwise one could create an alias.

 

Well, that's what I'm asking how to do. In the short term I have it working because I passed net.ifnames=0 to the kernel, but it seems like a kludge.

----------

## Buffoon

Forums like this are for generating and sharing ideas, not spoonfeeding. Do you have access to the internet search engines? Do you know how to read man pages?

https://duckduckgo.com/?q=linux+create+nic+alias&atb=v23__&ia=web

https://linux.die.net/man/8/ip

https://linux.die.net/man/8/ifconfig

----------

## Wormer

 *Buffoon wrote:*   

> Forums like this are for generating and sharing ideas, not spoonfeeding. Do you have access to the internet search engines? Do you know how to read man pages?
> 
> https://duckduckgo.com/?q=linux+create+nic+alias&atb=v23__&ia=web
> 
> https://linux.die.net/man/8/ip
> ...

 

I think you misunderstand. I did searches and came up with the same thing. I read man pages and came up with the same thing. Now, with the realization that I might be dense and just missing something, I know how to assign different IP addresses to the same NIC. What I'm trying to do here is assign a second device name to the same physical network device. I could, of course, make a virtual network device called "eth0" and bridge it over, but I was just wondering if there was a more elegant way.

In any case, I guess it's really a moot point because this is a VM, and it isn't like the hardware is going to change from the perspective of the operating system without me having pretty good control over the naming. So the fact that I'm using the "old" device names like eth0 doesn't really matter in that sense. That's more of an issue when you have a physical machine which you either change (breaking everything), or which has inconsistent initialization of devices resulting in "eth0" and "eth1" (for example) not always referring to the same card.

----------

## Hu

Your current approach of passing net.ifnames=0 is a kludge, but it is a kludge recommended by the people who created the problem by shipping device auto-renaming in the first place.  To the extent you can ever rely on a kludge to keep working, that one seems pretty safe, even aside from your later comments about having control over when the hardware changes.

I have never needed to do what you request, but I am not aware of any way to create a name alias.  I think most people expect that software should not be so fragile as this DRM'd component appears to be.

----------

## Ant P.

In this case it might make sense to put the entire app in a network namespace, and give it a tunnel device to the outside system named eth0. That way it'll work no matter what happens to the real system and you've also got a starting point to lock it down further.

----------

## s4e8

If DRM verify network driver name or bus-info, the only way is pass net.ifnames=0, otherwise you can create a dummy or macvlan interface.

ip link add link ens33 name eth0 address 2:3:4:5:6:7 type macvlan mode bridge

modprobe dummy numdummies=0; ip link add name eth0 address 2:3:4:5:6:7

macvlan may not re-use physical mac address, and dummy interface has no real traffic.

----------

## charles17

 *Wormer wrote:*   

>  I'm using systemd and it doesn't look like there is actually a /etc/udev/rules.d/80-net-setup-link.rules.

 

Files in /etc/udev/rules.d/ have to be manually created by yourself.  The package installs in /lib/udev/rules.d/.

An empty file foobar in /etc/udev/rules.d/ would overwrite an existing file fobar in /lib/udev/rules.d/

----------

