LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-22-2013, 02:07 AM   #1
er.car
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Rep: Reputation: 0
70-persistent-net.rules renames only one interface


Hi,

I’m running Slackware 14 on a test router with 8 interfaces and want to set custom names for interfaces eth2 to eth7, so I made the changes in the 70-persistent-net.rules files and rebooted. After the reboot only one of the interfaces is renamed as per the 70-persistent-net.rules file; all other interface retain their normal naming, i.e. eth2, eth3, and so on.

So I deleted the 70-persistent-net.rules file and rebooted again, it does not help. From what I see every time I delete the file any one of the interfaces is randomly renamed, but not more than one.

I checked dmesg and all I see over there is logs indicating all the interface have been bought up successfully, and after that one single entry “renamed network interface eth7 to xxx”. eth7 randomly changes every time I delete the 70-persistent-net.rules file and reboot.

In case it makes any difference, I’m running Slackware on Hyper-V with the interfaces configured as network adapters (not legacy).

Any tips on how to proceed?
 
Old 04-22-2013, 12:32 PM   #2
er.car
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Original Poster
Rep: Reputation: 0
Here is an update on this…

I know that the later Linux kernels have the hyper-v vm drivers integrated and also I can see in dmesg the hyper-v drivers are being loaded, apart from that the network cards work properly other than the problem of not being renamed as per 70-persistent-net.rules. So obviously this is not a driver problem; however, just to make sure it was not something related to the new synthetic devices in hyper-v I performed this test.

I added 2 legacy LAN cards and tried renaming them from the 70-persistent-net.rules file. So now my vm has this configuration…
2 legacy LAN cards
6 synthetic LAN cards
There are rules defined for all of them in 70-persistent-net.rules file; however, only 2 of the 8 interface get renamed, i.e. 1 legacy interface and 1 synthetic interface.

So it seems udev is renaming only one interface of each type. Is this what is supposed to happen if there are multiple NIC cards using the same driver? If no, how do I get the other interfaces renamed?
 
Old 04-23-2013, 06:01 PM   #3
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Rep: Reputation: Disabled
Hi we need more information on how you are setting the udev rules.

Can you paste the
Code:
/etc/udev/rules.d/70-persistent-net.rules
, so we can see what you have done, also you are using the Mac addresses of the NIC's to assign the udev rules right?

We also need an
Code:
ifconfig -a
of all the devices and the mac addresses so we can confirm the rules.

Udev can rename all the interfaces as needed with the right custom attributes.

You also need to state your questions clear, you are still after only eth2 and eth7 to be renamed right?
Also what do you wish to name them?
 
Old 04-24-2013, 10:01 AM   #4
er.car
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Original Poster
Rep: Reputation: 0
The behavior seems to be more random than what I initially thought it to be. I am trying to rename all of the interfaces. Here is the content of the files; it will give you a better idea of what exactly is happening…

Code:
# PCI device 0x1011:/sys/devices/pci0000:00/0000:00:0a.0 (tulip)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:2a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="int0"

# PCI device 0x1011:/sys/devices/pci0000:00/0000:00:0a.1 (tulip)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:21", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="int1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:a1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sa1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:a2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sa2"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:b1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sb1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:b2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sb2"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:c1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sc1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:c2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sc2"
Code:
eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:49:49:a1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.222.254  netmask 255.255.255.0  broadcast 192.168.222.255
        ether 00:15:5d:49:49:a2  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth3: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:49:49:b2  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth4: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:49:49:c1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth5: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:49:49:c2  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

int0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:49:49:2a  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 9  base 0x6000

int1: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:49:49:21  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 9  base 0xe000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sb1: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 00:15:5d:49:49:b1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Last edited by er.car; 04-24-2013 at 10:05 AM.
 
Old 04-25-2013, 12:27 AM   #5
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Rep: Reputation: Disabled
Hi after reviewing your udev entries things look correct:

Code:
# PCI device 0x1011:/sys/devices/pci0000:00/0000:00:0a.0 (tulip)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:2a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="int0"

# PCI device 0x1011:/sys/devices/pci0000:00/0000:00:0a.1 (tulip)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:21", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="int1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:a1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sa1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:a2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sa2"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:b1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sb1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:b2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sb2"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:c1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sc1"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:c2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sc2"

eth0: ether 00:15:5d:49:49:a1 
eth1: ether 00:15:5d:49:49:a2 
eth3: ether 00:15:5d:49:49:b2 
eth4: ether 00:15:5d:49:49:c1  
eth5: ether 00:15:5d:49:49:c2  
int0: ether 00:15:5d:49:49:2a = working
int1: ether 00:15:5d:49:49:21 = working
sb1:  ether 00:15:5d:49:49:b1 = working
However start going through:

Code:
udevadm info -a -p /sys/class/net/eth0
udevadm info -a -p /sys/class/net/eth1
udevadm info -a -p /sys/class/net/eth3
udevadm info -a -p /sys/class/net/eth4
udevadm info -a -p /sys/class/net/eth5
Try another custom attribute apart from the MAC address.
 
Old 04-25-2013, 08:53 AM   #6
er.car
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Original Poster
Rep: Reputation: 0
Hi,

I have tried setting the rules based on ifindex, however it still does not seem to work. I have set rules for all devices similar to this . . .

Code:
# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:49:49:a1", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{ifindex}=="4", KERNEL=="eth*", NAME="sa1"
I'm not sure if this is related; but, I am running Slackware on Hyper-V, and the udev rules are not generated by default (at least not on Slackware, I’m not sure about other distros) for VMs running on Hyper-V or VMware. There is a check in the 75-persistent-net-generator.rules file which prevents the udev rules from generating.

Code:
# ignore VMWare virtual interfaces
# ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
# ignore Hyper-V virtual interfaces
# ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end"
I had to hash out these lines to force udev to create rules for my NICs. Does anyone know why VMware and Hyper-V virtual interfaces are skipped?
 
Old 04-25-2013, 05:25 PM   #7
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Rep: Reputation: Disabled
This might give you some more ideas to try:

http://www.linuxquestions.org/questi...-rules-907381/
http://www.linuxquestions.org/questi...es-4175459287/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] /etc/udev/rules.d/70-persistent-net.rules and 'ip link' rename rakeafake Linux - Networking 4 02-01-2016 08:34 PM
[SOLVED] Missing /etc/udev/rules.d/70-persistent-net.rules - Chapter 7.2.1. Mordillo98 Linux From Scratch 5 06-11-2012 08:37 PM
Will Deleting 70-persistent-cd.rules and 70-persistent-net.rules Work As a "Live USB" Konphine Linux - General 1 10-09-2011 03:55 PM
Slack 13.1 : /etc/udev/rules.d70-persistent-net.rules Ramurd Slackware 10 02-18-2011 09:56 AM
cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory rcg1984 Linux From Scratch 2 09-17-2008 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration