source: chapter07/network.xml@ 29723b9

Last change on this file since 29723b9 was 6a0e6f3, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • Remove the spurious <info> tags that I thought were necessary but evidently aren't

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/LFS-RNG/BOOK@4387 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 4.1 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE section [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<section xmlns="http://docbook.org/docbook-ng"
7 xml:id="ch-scripts-network">
8<title>Configuring the network script</title>
9<?dbhtml filename="network.html"?>
10
11<indexterm zone="ch-scripts-network">
12<primary sortas="d-network">network</primary>
13<secondary>configuring</secondary></indexterm>
14
15<para>This section only applies if you're going to configure a network
16card.</para>
17
18<para>If you don't have any network cards, you are most likely not going to
19create any configuration files relating to network cards. If that is the
20case, you must remove the <filename class="symlink">network</filename> symlinks from all the
21run-level directories
22(<filename class="directory">/etc/rc.d/rc*.d</filename>)</para>
23
24<section>
25<title>Creating network interface configuration files</title>
26
27<para>Which interfaces are brought up and down by the network script depends on
28the files in the <filename class="directory">/etc/sysconfig/network-devices</filename> directory. This
29directory should contain subdirectories in the form of
30<filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a network
31interface name (such as eth0)</para>
32
33<para>If you decide to rename or move this
34<filename class="directory">/etc/sysconfig/network-devices</filename> directory,
35make sure you update the <filename>/etc/sysconfig/rc</filename> file as well and
36update the <quote>network_devices</quote> by providing it with the new path.</para>
37
38<para>Now, new files are created in that directory. The following command
39creates a sample <filename>ipv4</filename> file for the
40<filename>eth0</filename> device:</para>
41
42<screen><userinput>cd /etc/sysconfig/network-devices &amp;&amp;
43mkdir ifconfig.eth0 &amp;&amp;
44cat &gt; ifconfig.eth0/ipv4 &lt;&lt; "EOF"
45ONBOOT=yes
46SERVICE=ipv4-static
47IP=192.168.1.1
48GATEWAY=192.168.1.2
49PREFIX=24
50BROADCAST=192.168.1.255
51EOF</userinput></screen>
52
53<para>Of course, the values of those variables have to be changed in every file
54to match the proper setup. If the ONBOOT variable is set to <quote>yes</quote>,
55the network script will bring up the equivalent interface during the booting of
56the system. If set to anything but <quote>yes</quote>, the equivalent interface
57will be ignored by the network script and not brought up.</para>
58
59<para>The SERVICE entry defines the method of obtaining the IP address. The LFS
60bootscripts have a modular IP assignment format, and by creating additional
61files in
62<filename class="directory">/etc/sysconfig/network-devices/services</filename>,
63you can allow other IP assignment methods. This would commonly be used if you
64need DHCP, which is addressed in the BLFS book.</para>
65
66<para>Of course, GATEWAY should contain the IP of your default gateway, if you
67have one. If not, then don't include the GATEWAY line in the configuration
68file.</para>
69
70</section>
71
72<section xml:id="resolv.conf">
73<title>Creating the /etc/resolv.conf file</title>
74<indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm>
75
76<para>If you're going to be connected to the Internet then most likely you'll
77need some means of DNS name resolution to resolve Internet domain names to IP
78addresses. This is best achieved by placing the IP address of your assigned DNS
79resolver, available from your ISP (Internet Service Provider) or network
80administrator, into <filename>/etc/resolv.conf</filename>. Create the file by
81running the following:</para>
82
83<screen><userinput>cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
84# Begin /etc/resolv.conf
85
86domain {<replaceable>[Your Domain Name]</replaceable>}
87nameserver <replaceable>[IP address of your nameserver]</replaceable>
88
89# End /etc/resolv.conf
90EOF</userinput></screen>
91
92<para>Of course, replace
93<replaceable>[IP address of your nameserver]</replaceable> with the IP address
94of the DNS resolver assigned for your use. There will often be more than one
95entry (requirements demand secondary servers for fallback capability). The IP
96address may even be a router on your local network.</para>
97
98</section>
99
100</section>
Note: See TracBrowser for help on using the repository browser.