2007-08-02 23:19:41 +04:00
# do not edit this file, it will be overwritten on update
2006-09-05 17:20:28 +04:00
# these rules generate rules for persistent network device naming
2007-09-21 19:42:46 +04:00
#
# variables used to communicate:
# MATCHADDR MAC address used for the match
# MATCHID bus_id used for the match
# MATCHDRV driver name used for the match
# MATCHIFTYPE interface type match
# COMMENT comment to add to the generated rule
# INTERFACE_NAME requested name supplied by external tool
# INTERFACE_NEW new interface name returned by rule writer
2006-09-05 17:20:28 +04:00
2007-08-02 23:19:41 +04:00
ACTION!="add", GOTO="persistent_net_generator_end"
SUBSYSTEM!="net", GOTO="persistent_net_generator_end"
# ignore the interface if a name has already been set
NAME=="?*", GOTO="persistent_net_generator_end"
2006-09-05 17:20:28 +04:00
2007-09-21 19:42:46 +04:00
# device name whitelist
2008-04-15 02:21:51 +04:00
KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"
2007-09-21 19:42:46 +04:00
2007-08-02 23:19:41 +04:00
# ignore Xen virtual interfaces
SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
2006-09-09 16:45:45 +04:00
2007-09-21 19:42:46 +04:00
# read MAC address
ENV{MATCHADDR}="$attr{address}"
2007-09-25 19:18:49 +04:00
# match interface type
ENV{MATCHIFTYPE}="$attr{type}"
2010-08-31 23:44:34 +04:00
# ignore KVM virtual interfaces
2010-09-03 16:08:14 +04:00
ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end"
2010-09-02 10:39:12 +04:00
# ignore VMWare virtual interfaces
ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
2011-04-18 07:11:53 +04:00
# ignore Hyper-V virtual interfaces
ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end"
2010-08-31 23:44:34 +04:00
2009-05-03 17:37:30 +04:00
# These vendors are known to violate the local MAC address assignment scheme
# Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom
ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist"
# 3Com
ENV{MATCHADDR}=="02:60:60:*", GOTO="globally_administered_whitelist"
# 3Com IBM PC; Imagen; Valid; Cisco; Apple
ENV{MATCHADDR}=="02:60:8c:*", GOTO="globally_administered_whitelist"
# Intel
ENV{MATCHADDR}=="02:a0:c9:*", GOTO="globally_administered_whitelist"
# Olivetti
ENV{MATCHADDR}=="02:aa:3c:*", GOTO="globally_administered_whitelist"
# CMC Masscomp; Silicon Graphics; Prime EXL
ENV{MATCHADDR}=="02:cf:1f:*", GOTO="globally_administered_whitelist"
# Prominet Corporation Gigabit Ethernet Switch
ENV{MATCHADDR}=="02:e0:3b:*", GOTO="globally_administered_whitelist"
# BTI (Bus-Tech, Inc.) IBM Mainframes
ENV{MATCHADDR}=="02:e6:d3:*", GOTO="globally_administered_whitelist"
# Realtek
ENV{MATCHADDR}=="52:54:00:*", GOTO="globally_administered_whitelist"
# Novell 2000
ENV{MATCHADDR}=="52:54:4c:*", GOTO="globally_administered_whitelist"
# Realtec
ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist"
# Kingston Technologies
ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist"
2009-08-16 23:12:04 +04:00
# match interface dev_id
ATTR{dev_id}=="?*", ENV{MATCHDEVID}="$attr{dev_id}"
2007-09-21 19:42:46 +04:00
# do not use "locally administered" MAC address
ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}=""
# do not use empty address
ENV{MATCHADDR}=="00:00:00:00:00:00", ENV{MATCHADDR}=""
2009-05-03 17:37:30 +04:00
LABEL="globally_administered_whitelist"
2007-09-21 19:42:46 +04:00
# build comment line for generated rule:
2007-07-25 17:42:39 +04:00
SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($driver)"
2009-04-26 22:53:30 +04:00
SUBSYSTEMS=="usb", ATTRS{idVendor}=="?*", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($driver)"
2007-07-25 20:16:11 +04:00
SUBSYSTEMS=="pcmcia", ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id} ($driver)"
2006-09-09 16:45:45 +04:00
SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})"
2006-09-05 17:20:28 +04:00
2008-05-26 19:11:13 +04:00
# ibmveth likes to use "locally administered" MAC addresses
DRIVERS=="ibmveth", ENV{MATCHADDR}="$attr{address}", ENV{COMMENT}="ibmveth ($id)"
2007-09-21 19:42:46 +04:00
# S/390 uses id matches only, do not use MAC address match
SUBSYSTEMS=="ccwgroup", ENV{COMMENT}="S/390 $driver device at $id", ENV{MATCHID}="$id", ENV{MATCHDRV}="$driver", ENV{MATCHADDR}=""
2007-11-20 20:18:03 +03:00
# see if we got enough data to create a rule
ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", GOTO="persistent_net_generator_end"
2007-09-21 19:42:46 +04:00
# default comment
2008-05-26 19:11:13 +04:00
ENV{COMMENT}=="", ENV{COMMENT}="net device ($attr{driver})"
2007-08-02 23:19:41 +04:00
2007-09-21 19:42:46 +04:00
# write rule
DRIVERS=="?*", IMPORT{program}="write_net_rules"
2007-08-02 23:19:41 +04:00
2007-09-21 19:42:46 +04:00
# rename interface if needed
2006-09-05 17:20:28 +04:00
ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
LABEL="persistent_net_generator_end"