aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07/network.xml
diff options
context:
space:
mode:
authorArchaic <archaic@linuxfromscratch.org>2006-04-13 18:45:33 +0000
committerArchaic <archaic@linuxfromscratch.org>2006-04-13 18:45:33 +0000
commitd2c332bc21267f5e01cb545d3f01cae1dcacdae3 (patch)
tree1514dfbf9b2db00d013d0f64558eef3fcdc1b402 /chapter07/network.xml
parentdd7ed7b42feb0b8c450dcf2314e11cbfb0de03c6 (diff)
Merged the udev_update branch to trunk.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7509 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07/network.xml')
-rw-r--r--chapter07/network.xml42
1 files changed, 42 insertions, 0 deletions
diff --git a/chapter07/network.xml b/chapter07/network.xml
index c09f92431..ac6082271 100644
--- a/chapter07/network.xml
+++ b/chapter07/network.xml
@@ -24,6 +24,48 @@
class="directory">/etc/rc.d/rc*.d</filename>).</para>
<sect2>
+ <title>Creating stable names for network interfaces</title>
+
+ <para>Instructions in this section are optional if you have only one
+ network card.</para>
+
+ <para>With Udev and modular network drivers, the network interface numbering
+ is not persistent across reboots by default, because the drivers are loaded
+ in parallel and, thus, in random order. For example, on a computer having
+ two network cards made by Intel and Realtek, the network card manufactured
+ by Intel may become <filename class="devicefile">eth0</filename> and the
+ Realtek card becomes <filename class="devicefile">eth1</filename>. In some
+ cases, after a reboot the cards get renumbered the other way around. To
+ avoid this, create Udev rules that assign stable names to network cards
+ based on their MAC addresses.</para>
+
+ <para>First, find out the MAC addresses of your network cards:</para>
+
+<screen role="nodump"><userinput>grep -H . /sys/class/net/*/address</userinput></screen>
+
+ <para>For each network card (but not for the loopback interface),
+ invent a descriptive name, such as <quote>realtek</quote>, and create
+ Udev rules similar to the following:</para>
+
+<screen role="nodump"><userinput>cat &gt; /etc/udev/rules.d/26-network.rules &lt;&lt; "EOF"
+<literal>ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="<replaceable>52:54:00:12:34:56</replaceable>", NAME="<replaceable>realtek</replaceable>"
+ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="<replaceable>00:a0:c9:78:9a:bc</replaceable>", NAME="<replaceable>intel</replaceable>"</literal>
+EOF</userinput></screen>
+
+ <para>These rules will always rename the network cards to
+ <quote>realtek</quote> and <quote>intel</quote>, independently of the
+ original numbering provided by the kernel. Use these names instead of
+ <quote>eth0</quote> in the network interface configuration files created
+ below.</para>
+
+ <note>
+ <para>Persistent names must be different from the default network
+ interface names assigned by the kernel.</para>
+ </note>
+
+ </sect2>
+
+ <sect2>
<title>Creating Network Interface Configuration Files</title>
<para>Which interfaces are brought up and down by the network script