rakeafake |
05-24-2012 01:31 PM |
/etc/udev/rules.d/70-persistent-net.rules and 'ip link' rename
I plugged in two TRENDnet TU-ET100C USB NICs;
CentOS6 was giving me the name eth5 for one of them;
I wanted this particular NIC to have the name eth3;
Eventually I edited /etc/udev/rules.d/70-persistent-net.rules by hand and it gave me the name I wanted;
That might have been the end of the issue, except I tried a test to see what I the ip command would do;
my commands was this:
Code:
ip link set eth5 name eth3
This seemed to cause odd duplicate naming to happen;
When I typed one of the NICs was called 'rename4';
After various spazzy other attempts to undo this, this is the state of my 70-persistent-net.rules file:
Code:
centos6> cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x10bd (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:4f:bf:36:6a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x1229 (e100)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:02:b3:10:98:a6", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x1229 (e100)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:02:b3:10:96:b1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# USB device 0x07a6:0x8511 (usb) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:d1:1f:e1:e7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# USB device 0x07a6:0x8511 (usb) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:d1:1f:da:fb", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
# USB device 0x07a6:0x8511 (usb) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:d1:1f:da:fb", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
My questions are these;
How do I remove the (custom name provided by external tool) entries?
Which 'external tool' is causing these entries?
How do I undo these changes?
I just want the two USB NICs to be eth3 and eth4 as they would be discovered normally. This is because currently eth4 is not being brought up at boot time.
Here is my ip link show after bootup:
Code:
centos6> ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 00:1e:4f:bf:36:6a brd ff:ff:ff:ff:ff:ff
3: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:14:d1:1f:e1:e7 brd ff:ff:ff:ff:ff:ff
4: eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:14:d1:1f:da:fb brd ff:ff:ff:ff:ff:ff
5: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:02:b3:10:98:a6 brd ff:ff:ff:ff:ff:ff
6: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:02:b3:10:96:b1 brd ff:ff:ff:ff:ff:ff
Here is my ifconfig after bootup:
Code:
centos6> ifconfig
eth0 Link encap:Ethernet HWaddr 00:1E:4F:BF:36:6A
UP 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:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:21 Memory:febe0000-fec00000
eth1 Link encap:Ethernet HWaddr 00:02:B3:10:98:A6
inet addr:10.0.15.241 Bcast:10.0.255.255 Mask:255.255.0.0
inet6 addr: fe80::202:b3ff:fe10:98a6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5458 errors:0 dropped:0 overruns:0 frame:0
TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:517619 (505.4 KiB) TX bytes:16134 (15.7 KiB)
eth2 Link encap:Ethernet HWaddr 00:02:B3:10:96:B1
inet6 addr: fe80::202:b3ff:fe10:96b1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10760 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1046125 (1021.6 KiB) TX bytes:368 (368.0 b)
eth3 Link encap:Ethernet HWaddr 00:14:D1:1F:E1:E7
inet6 addr: fe80::214:d1ff:fe1f:e1e7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:578 (578.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
I found some work-arounds using a rule set 71-persistent-net-myrules.rules, but I want to know how udev is adding these custom rules and how to configure it not to add them.
|