Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Making a ghost eth0
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Wormer
n00b
n00b


Joined: 20 Jun 2015
Posts: 7

PostPosted: Sun Nov 06, 2016 6:53 pm    Post subject: Making a ghost eth0 Reply with quote

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.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Nov 06, 2016 6:59 pm    Post subject: Reply with quote

Not sure about systemd, otherwise one could create an alias.
Back to top
View user's profile Send private message
Wormer
n00b
n00b


Joined: 20 Jun 2015
Posts: 7

PostPosted: Sun Nov 06, 2016 7:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Nov 06, 2016 7:36 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Wormer
n00b
n00b


Joined: 20 Jun 2015
Posts: 7

PostPosted: Sun Nov 06, 2016 8:48 pm    Post subject: Reply with quote

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

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


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.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13855

PostPosted: Mon Nov 07, 2016 1:57 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5762

PostPosted: Mon Nov 07, 2016 4:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 309

PostPosted: Mon Nov 07, 2016 7:23 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2616

PostPosted: Mon Nov 07, 2016 7:24 am    Post subject: Re: Making a ghost eth0 Reply with quote

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/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum