Changeset 5ba3d1d for chapter07/network.xml
- Timestamp:
- 08/08/2004 02:11:27 AM (20 years ago)
- Branches:
- 6.0
- Children:
- 1dc34de7
- Parents:
- ef13657
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/network.xml
ref13657 r5ba3d1d 12 12 <secondary>configuring</secondary></indexterm> 13 13 14 <para>This section only applies if you're going to configure a network15 c ard.</para>14 <para>This section only applies if a network card is to be 15 configured.</para> 16 16 17 <para>If you don't have any network cards, you are most likely not goingto18 create any configuration files relating to network cards. If that is the19 case, you must remove the <filename class="symlink">network</filename> symlinks from all the 20 run-level directories 21 (<filename class="directory">/etc/rc.d/rc*.d</filename>)</para>17 <para>If a network card will not be used, there is likely no need to 18 create any configuration files relating to network cards. If that is 19 the case, remove the <filename class="symlink">network</filename> 20 symlinks from all run-level directories (<filename 21 class="directory">/etc/rc.d/rc*.d</filename>).</para> 22 22 23 23 <sect2> 24 24 <title>Creating network interface configuration files</title> 25 25 26 <para>Which interfaces are brought up and down by the network script depends on 27 the files in the <filename class="directory">/etc/sysconfig/network-devices</filename> directory. This 28 directory should contain subdirectories in the form of 29 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a network 30 interface name (such as eth0)</para> 26 <para>Which interfaces are brought up and down by the network script 27 depends on the files in the <filename 28 class="directory">/etc/sysconfig/network-devices</filename> directory. 29 This directory should contain files in the form of 30 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a 31 network interface name (such as eth0 or eth0:1)</para> 31 32 32 <para>If you decide to rename or move this 33 <filename class="directory">/etc/sysconfig/network-devices</filename> directory, 34 make sure you update the <filename>/etc/sysconfig/rc</filename> file as well and 35 update the <quote>network_devices</quote> by providing it with the new path.</para> 33 <para>If the <filename 34 class="directory">/etc/sysconfig/network-devices</filename> directory 35 is to be renamed or moved, make sure to edit the 36 <filename>/etc/sysconfig/rc</filename> file and update the 37 <quote>network_devices</quote> option by providing it with the new 38 path.</para> 36 39 37 <para>Now, new files are created in th at directory. The following command38 c reates a sample <filename>ipv4</filename> file for the39 < filename>eth0</filename> device:</para>40 <para>Now, new files are created in those directory. The following 41 command creates a sample <filename>ipv4</filename> file for the 42 <emphasis>eth0</emphasis> device:</para> 40 43 41 44 <screen><userinput>cd /etc/sysconfig/network-devices && … … 50 53 EOF</userinput></screen> 51 54 52 <para>Of course, the values of those variables have to be changed in every file 53 to match the proper setup. If the ONBOOT variable is set to <quote>yes</quote>, 54 the network script will bring up the equivalent interface during the booting of 55 the system. If set to anything but <quote>yes</quote>, the equivalent interface 56 will be ignored by the network script and not brought up.</para> 55 <para>The values of those variables must be changed in every file to 56 match the proper setup. If the <emphasis>ONBOOT</emphasis> variable is 57 set to <quote>yes</quote>, the network script will bring up the 58 Network Interface Card (NIC) during the booting of the system. If set 59 to anything but <quote>yes</quote>, the NIC will be ignored by the 60 network script and not brought up.</para> 57 61 58 <para>The SERVICE entry defines the method of obtaining the IP address. The LFS59 bootscripts have a modular IP assignment format, and by creating additional 60 files in 61 <filename class="directory">/etc/sysconfig/network-devices/services</filename>, 62 you can allow other IP assignment methods. This would commonly be used if you 63 needDHCP, which is addressed in the BLFS book.</para>62 <para>The <emphasis>SERVICE</emphasis> variable defines the method of 63 obtaining the IP address. The LFS bootscripts have a modular IP 64 assignment format, and creating additional files in the <filename 65 class="directory">/etc/sysconfig/network-devices/services</filename> 66 directory allows other IP assignment methods. This is commonly used 67 for DHCP, which is addressed in the BLFS book.</para> 64 68 65 <para>Of course, GATEWAY should contain the IP of your default gateway, if you 66 have one. If not, then don't include the GATEWAY line in the configuration 67 file.</para> 69 <para>The <emphasis>GATEWAY</emphasis> variable should contain the IP 70 the your default gateway, if one is present. If not, then comment out 71 the variable entirely.</para> 72 73 <para>The <emphasis>PREFIX</emphasis> variable needs to contain the 74 number of bits used in the subnet. Each octet in an IP address is 8 75 bits. If the subnet's netmask is 255.255.255.0, then it is using the 76 first three octets (24 bits) to specify the network number. If the 77 netmask is 255.255.255.240 it would be using the first 28 bits. 78 Prefixes longer than 24 bits are commonly used by DSL- and cable-based 79 Internet Service Providers. In this example (PREFIX=24) the netmask 80 is 255.255.255.0. Adjust according to your subnet.</para> 68 81 69 82 </sect2> … … 73 86 <indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm> 74 87 75 <para>If you're going to be connected to the Internet then most likely you'll 76 need some means of DNS name resolution to resolve Internet domain names to IP 77 addresses. This is best achieved by placing the IP address of your assigned DNS 78 resolver, available from your ISP (Internet Service Provider) or network 79 administrator, into <filename>/etc/resolv.conf</filename>. Create the file by 80 running the following:</para> 88 <para>If the system is going to be connected to the Internet, it will 89 need some means of DNS name resolution to resolve Internet domain 90 names to IP addresses, and vice versa. This is best achieved by 91 placing the IP address of the DNS server, available from the Internet 92 Service Provider (ISP) or network administrator, into 93 <filename>/etc/resolv.conf</filename>. Create the file by running the 94 following:</para> 81 95 82 96 <screen><userinput>cat > /etc/resolv.conf << "EOF" … … 84 98 85 99 domain {<replaceable>[Your Domain Name]</replaceable>} 86 nameserver <replaceable>[IP address of your nameserver]</replaceable> 100 nameserver <replaceable>[IP address of your primary nameserver]</replaceable> 101 nameserver <replaceable>[IP address of your secondary nameserver]</replaceable> 87 102 88 103 # End /etc/resolv.conf 89 104 EOF</userinput></screen> 90 105 91 <para>Of course, replace 92 <replaceable>[IP address of your nameserver]</replaceable> with the IP address 93 of the DNS resolver assigned for your use. There will often be more than one 94 entry (requirements demand secondary servers for fallback capability). The IP 95 address may even be a router on your local network.</para> 96 106 <para>Replace <replaceable>[IP address of the 107 nameserver]</replaceable> with the IP address of the DNS most 108 appropriate for the setup. There will often be more than one entry 109 (requirements demand secondary servers for fallback capability). If 110 you only need or want one DNS server, simply remove the second 111 <emphasis>nameserver</emphasis> line from the file. The IP address may 112 also be a router on the local network.</para> 97 113 </sect2> 98 114 99 115 </sect1> 116
Note:
See TracChangeset
for help on using the changeset viewer.