source: clfs-embedded/BOOK/bootscripts/common/network.xml@ 003388c

Last change on this file since 003388c was 1d67150, checked in by Jim Gifford <clfs@…>, 18 years ago

Removed udev
Added the use of mdev
Removed udev rules
Added bootscripts configuration information

  • Property mode set to 100644
File size: 4.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-scripts-network">
9 <?dbhtml filename="network.html"?>
10
11 <title>Configuring the network Script</title>
12
13 <indexterm zone="ch-scripts-network">
14 <primary sortas="d-network">network</primary>
15 <secondary>configuring</secondary></indexterm>
16
17 <sect2>
18 <title>Creating Network Interface Configuration Files</title>
19
20 <para>Which interfaces are brought up and down by the network script
21 depends on the files and directories in the <filename
22 class="directory">/etc/network.d</filename> hierarchy.
23 This directory should contain a file for each interface to be
24 configured, such as <filename>interface.xyz</filename>, where
25 <quote>xyz</quote> is a network interface name. Inside this file we
26 would be defining the attributes to this interface, such as its IP
27 address(es), subnet masks, and so forth.</para>
28
29 <para>The following command creates the <filename>network.conf</filename>
30 file for use by the entire system:</para>
31
32<screen><userinput>cd /etc/network.d &amp;&amp;
33cat &gt; /etc/network.d/interface.eth0 &lt;&lt; "EOF"
34<literal># /etc/network.conf
35# Global Networking Configuration
36# interface configuration is in /etc/network.d/
37
38# set to yes to enable networking
39NETWORKING=yes
40
41# set to yes to set default route to gateway
42USE_GATEWAY=no
43
44# set to gateway IP address
45GATEWAY=192.168.0.1</literal>
46EOF</userinput></screen>
47
48 <para>The <envar>GATEWAY</envar> variable should contain the default
49 gateway IP address, if one is present. If not, then comment out the
50 variable entirely.</para>
51
52 <para>The following command creates a sample <filename>interface.eth0</filename>
53 file for the <emphasis>eth0</emphasis> device:</para>
54
55<screen><userinput>cd /etc/network.d &amp;&amp;
56cat &gt; /etc/network.d/interface.eth0 &lt;&lt; "EOF"
57<literal># Network Interface Configuration
58
59# network device name
60INTERFACE=eth0
61
62# set to yes to use DHCP instead of the settings below
63DHCP=no
64
65# IP address
66IPADDRESS=192.168.1.2
67
68# netmask
69NETMASK=255.255.255.0
70
71# broadcast address
72BROADCAST=192.168.1.255</literal>
73EOF</userinput></screen>
74
75 <para>The <envar>INTERFACE</envar> variable should contain the name of
76 the interface interface.</para>
77
78 <para>The <envar>DHCP</envar> variable if set to yes will allow you to
79 use dhcp. If set to no, you will need to configure the rest of the options.</para>
80
81 <para>The <envar>IPADDRESS</envar> variable should contain the default
82 IP address for this interface.</para>
83
84 <para>The <envar>NETMASK</envar> variable should contain the default
85 Subnet Mask for the IP address for this interface.</para>
86
87 <para>The <envar>BROADCAST</envar> variable should contain the default
88 Broadcast Address for the Subnet Mask of the IP Range being used on
89 this interface.</para>
90
91 </sect2>
92
93 <sect2 id="resolv.conf">
94 <title>Creating the /etc/resolv.conf File</title>
95
96 <indexterm zone="resolv.conf">
97 <primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary>
98 </indexterm>
99
100 <para>If the system is going to be connected to the Internet, it will
101 need some means of Domain Name Service (DNS) name resolution to
102 resolve Internet domain names to IP addresses, and vice versa. This is
103 best achieved by placing the IP address of the DNS server, available
104 from the ISP or network administrator, into
105 <filename>/etc/resolv.conf</filename>. Create the file by running the
106 following:</para>
107
108<screen><userinput>cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
109<literal># Begin /etc/resolv.conf
110
111domain <replaceable>[Your Domain Name]</replaceable>
112nameserver <replaceable>[IP address of your primary nameserver]</replaceable>
113nameserver <replaceable>[IP address of your secondary nameserver]</replaceable>
114
115# End /etc/resolv.conf</literal>
116EOF</userinput></screen>
117
118 <para>Replace <replaceable>[IP address of the nameserver]</replaceable>
119 with the IP address of the DNS most appropriate for the setup. There will
120 often be more than one entry (requirements demand secondary servers for
121 fallback capability). If you only need or want one DNS server, remove the
122 second <emphasis>nameserver</emphasis> line from the file. The IP address
123 may also be a router on the local network.</para>
124
125 </sect2>
126
127</sect1>
Note: See TracBrowser for help on using the repository browser.