[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ethernet configuration



I've found the /etc/udev/rules.d/z25_persistent-net.rules file:



# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# MAC addresses must be written in lowercase.

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:e9:01:77", NAME="eth0"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:f2:c0:89", NAME="eth1"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:30:e1:28", NAME="eth2"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:6f:75:06", NAME="eth3"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:25:de:d3", NAME="eth4"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:b5:70:4b", NAME="eth5"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:06:6c:76", NAME="eth6"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:db:fb:52", NAME="eth7"

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:00:6c:32:fa:60", NAME="eth8"






Taking a look on write_net_rules wasn't very useful (I don't understand this scripting language very well). My best guess is that it has something to do with this bit:






# If a rule using the current name already exists then find a new name and
# report it to udev which will rename the interface.
basename=${INTERFACE%%[0-9]*}
if interface_name_taken; then
  INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
  if [ ! -t 1 ]; then
    echo "INTERFACE_NEW=$INTERFACE"
  fi
fi

# the DRIVERS key is needed to not match bridges and VLAN sub-interfaces
match="DRIVERS==\"?*\", ATTRS{address}==\"$MAC_ADDR\""
if [ $basename = "ath" -o $basename = "wlan" ]; then
  match="$match, ATTRS{type}==\"1\"" # do not match the wifi* interfaces
fi

write_rule "$match" "$INTERFACE" "$COMMENT"





What exactly should this script be doing? Will modyfing only 'z25_persistent-net.rules' be enough? (I didn't tried because I didn't looked for the MAC adress).

André Timpanaro

Reply to: