Changeset c226182 for chapter07/network.xml
- Timestamp:
- 08/03/2006 07:29:29 PM (18 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- bfa508ae
- Parents:
- a15464d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/network.xml
ra15464d rc226182 49 49 Udev rules similar to the following:</para> 50 50 51 <screen role="nodump"><userinput>cat > /etc/udev/rules.d/26-network.rules << "EOF" 52 <literal>ACTION=="add", SUBSYSTEM=="net", DRIVER=="?*", SYSFS{address}=="<replaceable>00:e0:4c:12:34:56</replaceable>", NAME="<replaceable>realtek</replaceable>" 53 ACTION=="add", SUBSYSTEM=="net", DRIVER=="?*", SYSFS{address}=="<replaceable>00:a0:c9:78:9a:bc</replaceable>", NAME="<replaceable>intel</replaceable>"</literal> 54 EOF</userinput></screen> 55 56 <para>The DRIVER=="?*" key prevents Udev from attempting to rename 8021Q 57 VLAN interfaces (not available without the Vlan package from 58 <ulink url="http://www.candelatech.com/~greear/vlan/"/>). 59 This is necessary since VLANs have the same MAC address as 60 the real network card.</para> 51 <screen role="nodump"><userinput>cat > /etc/udev/rules.d/26-network.rules << EOF 52 <literal>ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="<replaceable>00:e0:4c:12:34:56</replaceable>", \ 53 NAME="<replaceable>realtek</replaceable>" 54 ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="<replaceable>00:a0:c9:78:9a:bc</replaceable>", \ 55 NAME="<replaceable>intel</replaceable>"</literal> 56 EOF</userinput></screen> 61 57 62 58 <!-- Yes, I know that VLANs are beyond BLFS. This is not the reason to get them 63 59 incorrect by default when every distro does this right. --> 64 60 61 <note> 62 <para>Although the examples in this book work properly, be aware 63 that Udev does not recognize the backslash for line continuation. 64 If modifying Udev rules with an editor, be sure to leave each rule 65 on one physical line.</para> 66 </note> 67 65 68 <para>If you are going to use the bus position as a key, create 66 69 Udev rules similar to the following:</para> 67 70 68 <screen role="nodump"><userinput>cat > /etc/udev/rules.d/26-network.rules << "EOF" 69 <literal>ACTION=="add", SUBSYSTEM=="net", BUS=="<replaceable>pci</replaceable>", ID=="<replaceable>0000:00:0c.0</replaceable>", NAME="<replaceable>realtek</replaceable>" 70 ACTION=="add", SUBSYSTEM=="net", BUS=="<replaceable>pci</replaceable>", ID=="<replaceable>0000:00:0d.0</replaceable>", NAME="<replaceable>intel</replaceable>"</literal> 71 <screen role="nodump"><userinput>cat > /etc/udev/rules.d/26-network.rules << EOF 72 <literal>ACTION=="add", SUBSYSTEM=="net", BUS=="<replaceable>pci</replaceable>", ID=="<replaceable>0000:00:0c.0</replaceable>", \ 73 NAME="<replaceable>realtek</replaceable>" 74 ACTION=="add", SUBSYSTEM=="net", BUS=="<replaceable>pci</replaceable>", ID=="<replaceable>0000:00:0d.0</replaceable>", \ 75 NAME="<replaceable>intel</replaceable>"</literal> 71 76 EOF</userinput></screen> 72 77 … … 79 84 of <quote>eth0</quote> in the network interface configuration files 80 85 below.</para> 86 87 <para>Note that the rules above don't work for every setup. For example, 88 MAC-based rules break when bridges or VLANs are used, because bridges and 89 VLANs have the same MAC address as the network card. One wants to rename 90 only the network card interface, not the bridge or VLAN interface, but the 91 example rule matches both. If you use such virtual interfaces, you have two 92 potential solutions. One is to add the DRIVER=="?*" key after 93 SUBSYSTEM=="net" in MAC-based rules which will stop matching the virtual 94 interfaces. This is known to fail with some older Ethernet cards because 95 they don't have the DRIVER variable in the uevent and thus the rule does 96 not match with such cards. Another solution is to switch to rules that use 97 the bus position as a key.</para> 98 99 <para>The second known non-working case is with wireless cards using the 100 MadWifi or HostAP drivers, because they create at least two interfaces with 101 the same MAC address and bus position. For example, the Madwifi driver 102 creates both an athX and a wifiX interface where X is a digit. To 103 differentiate these interfaces, add an appropriate KERNEL parameter such as 104 KERNEL=="ath*" after SUBSYSTEM=="net".</para> 105 106 <para>There may be other cases where the rules above don't work. Currently, 107 bugs on this topic are still being reported to Linux distributions, and no 108 solution that covers every case is available.</para> 81 109 82 110 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.