Changeset f3317d4 for chapter07/network.xml
- Timestamp:
- 02/15/2013 09:14:37 PM (11 years ago)
- Branches:
- 7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
- Children:
- b588d62
- Parents:
- 4a4e017
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/network.xml
r4a4e017 rf3317d4 17 17 <para>This section only applies if a network card is to be 18 18 configured.</para> 19 20 <para>If a network card will not be used, there is likely no need to create21 any configuration files relating to network cards. If that is the case, you22 will need to remove the <filename class="symlink">network</filename> symlinks23 from all run-level directories (<filename24 class="directory">/etc/rc.d/rc*.d</filename>) after the bootscripts are25 installed in <xref linkend="ch-scripts-bootscripts"/>.</para>26 27 <sect2 id='stable-net-names'>28 <title>Creating stable names for network interfaces</title>29 30 <para>If there is only one network interface in the system to be31 configured, this section is optional, although it will never be wrong to do32 it. In many cases (e.g. a laptop with a wireless and a wired interface),33 accomplishing the configuration in this section is necessary.</para>34 35 <para>With Udev and modular network drivers, the network interface numbering36 is not persistent across reboots by default, because the drivers are loaded37 in parallel and, thus, in random order. For example, on a computer having38 two network cards made by Intel and Realtek, the network card manufactured39 by Intel may become <filename class="devicefile">eth0</filename> and the40 Realtek card becomes <filename class="devicefile">eth1</filename>. In some41 cases, after a reboot the cards get renumbered the other way around. To42 avoid this, Udev comes with a script and some rules to assign stable names43 to network cards based on their MAC address.</para>44 45 <para>The rules were pre-generated in the build instructions for46 <application>udev (systemd)</application> in the last chapter. Inspect the47 <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to48 find out which name was assigned to which network device:</para>49 50 <screen role="nodump"><userinput>cat /etc/udev/rules.d/70-persistent-net.rules</userinput></screen>51 52 <note><para>In some cases such as when MAC addresess have been assigned to53 a network card manually or in a virtual environment such as Xen,54 the network rules file may not have been generated because addresses55 are not consistently assigned. In these cases, just continue to56 the next section.</para></note>57 58 <para>The file begins with a comment block followed by two lines for each59 NIC. The first line for each NIC is a commented description showing its60 hardware IDs (e.g. its PCI vendor and device IDs, if it's a PCI card),61 along with its driver in parentheses, if the driver can be found. Neither62 the hardware ID nor the driver is used to determine which name to give an63 interface; this information is only for reference. The second line is the64 Udev rule that matches this NIC and actually assigns it a name.</para>65 66 <para>All Udev rules are made up of several keys, separated by commas and67 optional whitespace. This rule's keys and an explanation of each of them68 are as follows:</para>69 70 <itemizedlist>71 <listitem>72 <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore73 devices that are not network cards.</para>74 </listitem>75 <listitem>76 <para><literal>ACTION=="add"</literal> - This tells Udev to ignore this77 rule for a uevent that isn't an add ("remove" and "change" uevents also78 happen, but don't need to rename network interfaces).</para>79 </listitem>80 <listitem>81 <para><literal>DRIVERS=="?*"</literal> - This exists so that Udev will82 ignore VLAN or bridge sub-interfaces (because these sub-interfaces do83 not have drivers). These sub-interfaces are skipped because the name84 that would be assigned would collide with their parent devices.</para>85 </listitem>86 <listitem>87 <para><literal>ATTR{address}</literal> - The value of this key is the88 NIC's MAC address.</para>89 </listitem>90 <listitem>91 <para><literal>ATTR{type}=="1"</literal> - This ensures the rule only92 matches the primary interface in the case of certain wireless drivers,93 which create multiple virtual interfaces. The secondary interfaces are94 skipped for the same reason that VLAN and bridge sub-interfaces are95 skipped: there would be a name collision otherwise.</para>96 </listitem>97 <listitem>98 <para><literal>KERNEL=="eth*"</literal> - This key was added to the99 Udev rule generator to handle machines that have multiple network100 interfaces, all with the same MAC address (the PS3 is one such101 machine). If the independent interfaces have different basenames,102 this key will allow Udev to tell them apart. This is generally not103 necessary for most Linux From Scratch users, but does not hurt.</para>104 </listitem>105 <listitem>106 <para><literal>NAME</literal> - The value of this key is the name that107 Udev will assign to this interface.</para>108 </listitem>109 </itemizedlist>110 111 <para>The value of <literal>NAME</literal> is the important part. Make sure112 you know which name has been assigned to each of your network cards before113 proceeding, and be sure to use that <literal>NAME</literal> value when114 creating your configuration files below.</para>115 116 </sect2>117 19 118 20 <sect2>
Note:
See TracChangeset
for help on using the changeset viewer.