Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
eudev wlan0 --> eth3
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
ShorTie
n00b
n00b


Joined: 12 Feb 2006
Posts: 29

PostPosted: Wed Jan 03, 2018 1:08 am    Post subject: eudev wlan0 --> eth3 Reply with quote

Would there be a way using a udev rule to change wlan0 to the next ethX name ??
Like wlan0 would become eth3.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2474

PostPosted: Wed Jan 03, 2018 2:04 am    Post subject: Reply with quote

The file is /etc/udev/rules.d/70-persistent-net.rules

You can do the research on how to use the file but do not, DO NOT name it eth3. The eth* are reserved for kernel names.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2614
Location: Illinois, USA

PostPosted: Wed Jan 03, 2018 3:11 am    Post subject: Reply with quote

Doctor, is Eth3 or ETH3 alright? Maybe best is netX, i.e. net0, net1, net2, net3. Anything but those horrible default unmemorable names?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2474

PostPosted: Wed Jan 03, 2018 3:21 am    Post subject: Reply with quote

net* is a common solution. The problem is when you generate a collision with the kernel names.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 12840

PostPosted: Wed Jan 03, 2018 3:40 am    Post subject: Reply with quote

ShorTie: please explain why you want to rename the device in this way. What do you hope to achieve by doing this?
Back to top
View user's profile Send private message
ShorTie
n00b
n00b


Joined: 12 Feb 2006
Posts: 29

PostPosted: Wed Jan 03, 2018 3:41 am    Post subject: Reply with quote

I'm working on a firewall where it uses only the eth%d names to get the devices

Code:
/* Get device name, eth%d is hard coded. */
sprintf(nexteth, "eth%d", nictocheck);
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2474

PostPosted: Wed Jan 03, 2018 3:45 am    Post subject: Reply with quote

If you want other people to use that firewall, then that check should be a nonstarter.

If this is your personal use, then it makes sense to rename everything to net{1,2,3}
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
ShorTie
n00b
n00b


Joined: 12 Feb 2006
Posts: 29

PostPosted: Wed Jan 03, 2018 3:48 am    Post subject: Reply with quote

it's Smoothwall, a very old well used firewall.
Most likely writen before there was even a wlanX.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2614
Location: Illinois, USA

PostPosted: Wed Jan 03, 2018 3:48 am    Post subject: Reply with quote

The Doctor wrote:
net* is a common solution. The problem is when you generate a collision with the kernel names.

To be more clear, my question was whether the names are case sensitive so that changing to upper case would not conflict.

So far, most of my bozes only have one card so that appending net.ifnames=0 in the grub kernel lines lets me keep eth0.
On the one old box that I'm setting up to use as a router per the wiki, I have eudev lines set up to name the two cards are lan0 and wan0 as that helps keep things straight whien setting up iptables.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2614
Location: Illinois, USA

PostPosted: Wed Jan 03, 2018 4:08 am    Post subject: Reply with quote

ShorTie wrote:
I'm working on a firewall where it uses only the eth%d names to get the devices

Code:
/* Get device name, eth%d is hard coded. */
sprintf(nexteth, "eth%d", nictocheck);

Patch the code to say
Code:
sprintf(nexteth, "net%d", nictocheck);
Can't say more without examining the code, but some sort of file lookup would be nice too or maybe a command line option to set the prefix.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2474

PostPosted: Wed Jan 03, 2018 4:20 am    Post subject: Reply with quote

@ShorTie Using a firewall that hasn't been updated for about 16 years? You may want to rethink that.

@Tony0945 I don't know about uppercase vs lowercase. It would make sense that it would not conflict, but I never had reason to try/investigate it.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
ShorTie
n00b
n00b


Joined: 12 Feb 2006
Posts: 29

PostPosted: Thu Jan 04, 2018 12:38 pm    Post subject: Reply with quote

The last update is like only a year old, next update is being worked on.

fest3er, the maintainer, can back with

Quote:
Don't see why you can't rename the IF. A rule like
Code:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:XX:XX:XX:XX:XX", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"


should become
Code:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:XX:XX:XX:XX:XX", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*|wlan*", NAME="eth5"




"KERNEL=="eth*|wlan*""
Does this sound feasible ??
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2614
Location: Illinois, USA

PostPosted: Thu Jan 04, 2018 3:18 pm    Post subject: Reply with quote

ShorTie wrote:
"KERNEL=="eth*|wlan*""
Does this sound feasible ??


If not just copy the line to make two rules, one for eth* the other for wlan*
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6843

PostPosted: Thu Jan 04, 2018 4:14 pm    Post subject: Reply with quote

It's just an "or" ; meaning if the kernel name is "eth*" OR "wlan*" rename it, and as you must fill the ATTR{ADDRESS} with the mac address of your wlan device, it's pretty safe to use that rule to change it.
Back to top
View user's profile Send private message
ShorTie
n00b
n00b


Joined: 12 Feb 2006
Posts: 29

PostPosted: Tue Jan 09, 2018 1:10 pm    Post subject: Reply with quote

Ok, who got the baseball bat ??
I need a beating of RTFMDF !!!

"...change only the value of the NAME= key."

And made up a 70-persistent-net.rules with it in it.
I got a eth1 .. :)~
And created a wpa_supplicant.conf
It works !!!!!!

Thankz Guys for the help.

Have A Great Day
ShorTie
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat 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