Changeset 1d67150 in clfs-embedded for BOOK/bootscripts/common
- Timestamp:
- Nov 14, 2006, 2:11:07 PM (18 years ago)
- Branches:
- master
- Children:
- 334e4cf
- Parents:
- ae024d6
- Location:
- BOOK/bootscripts/common
- Files:
-
- 2 added
- 4 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/bootscripts/common/hostname.xml
rae024d6 r1d67150 15 15 <secondary>configuring</secondary></indexterm> 16 16 17 <para>Part of the job of the <command>localnet</command> scriptis17 <para>Part of the job of the bootscripts is 18 18 setting the system's hostname. This needs to be configured in the 19 <filename>/etc/ sysconfig/network</filename> file.</para>19 <filename>/etc/HOSTNAME</filename> file.</para> 20 20 21 <para>Create the <filename> /etc/sysconfig/network</filename> file21 <para>Create the <filename>HOSTNAME</filename> file 22 22 and enter a hostname by running:</para> 23 23 24 <screen><userinput>echo " HOSTNAME=<replaceable>[lfs]</replaceable>" > ${CLFS}/etc/sysconfig/network</userinput></screen>24 <screen><userinput>echo "<replaceable>[lfs]</replaceable>" > ${CLFS}/etc/HOSTNAME</userinput></screen> 25 25 26 26 <para><replaceable>[lfs]</replaceable> needs to be replaced with the -
BOOK/bootscripts/common/network.xml
rae024d6 r1d67150 15 15 <secondary>configuring</secondary></indexterm> 16 16 17 <para>This section only applies if a network card is to be18 configured.</para>19 20 <para>If a network card will not be used, there is likely no need to21 create any configuration files relating to network cards. If that is22 the case, remove the <filename class="symlink">network</filename>23 symlinks from all run-level directories (<filename24 class="directory">/etc/rc.d/rc*.d</filename>).</para>25 26 17 <sect2> 27 18 <title>Creating Network Interface Configuration Files</title> … … 29 20 <para>Which interfaces are brought up and down by the network script 30 21 depends on the files and directories in the <filename 31 class="directory">/etc/ sysconfig/network-devices</filename> hierarchy.32 This directory should contain a sub-directoryfor each interface to be33 configured, such as <filename>i fconfig.xyz</filename>, where34 <quote>xyz</quote> is a network interface name. Inside this directory35 would be filesdefining the attributes to this interface, such as its IP22 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 36 27 address(es), subnet masks, and so forth.</para> 37 28 38 <para>The following command creates a sample <filename>ipv4</filename>39 file for the <emphasis>eth0</emphasis> device:</para>29 <para>The following command creates the <filename>network.conf</filename> 30 file for use by the entire system:</para> 40 31 41 <screen><userinput>cd /etc/sysconfig/network-devices && 42 mkdir -v ifconfig.eth0 && 43 cat > ifconfig.eth0/ipv4 << "EOF" 44 <literal>ONBOOT=yes 45 SERVICE=ipv4-static 46 IP=192.168.1.1 47 GATEWAY=192.168.1.2 48 PREFIX=24 49 BROADCAST=192.168.1.255</literal> 32 <screen><userinput>cd /etc/network.d && 33 cat > /etc/network.d/interface.eth0 << "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 39 NETWORKING=yes 40 41 # set to yes to set default route to gateway 42 USE_GATEWAY=no 43 44 # set to gateway IP address 45 GATEWAY=192.168.0.1</literal> 50 46 EOF</userinput></screen> 51 52 <para>The values of these variables must be changed in every file to match53 the proper setup. If the <envar>ONBOOT</envar> variable is set to54 <quote>yes</quote> the network script will bring up the Network Interface55 Card (NIC) during booting of the system. If set to anything but56 <quote>yes</quote> the NIC will be ignored by the network script and not57 be brought up.</para>58 59 <para>The <envar>SERVICE</envar> variable defines the method used for60 obtaining the IP address. The CLFS-Bootscripts package has a modular IP61 assignment format, and creating additional files in the <filename62 class="directory">/etc/sysconfig/network-devices/services</filename>63 directory allows other IP assignment methods. This is commonly used for64 Dynamic Host Configuration Protocol (DHCP), which is addressed in the65 BLFS book.</para>66 47 67 48 <para>The <envar>GATEWAY</envar> variable should contain the default … … 69 50 variable entirely.</para> 70 51 71 <para>The <envar>PREFIX</envar> variable needs to contain the number of 72 bits used in the subnet. Each octet in an IP address is 8 bits. If the 73 subnet's netmask is 255.255.255.0, then it is using the first three octets 74 (24 bits) to specify the network number. If the netmask is 255.255.255.240, 75 it would be using the first 28 bits. Prefixes longer than 24 bits are 76 commonly used by DSL and cable-based Internet Service Providers (ISPs). 77 In this example (PREFIX=24), the netmask is 255.255.255.0. Adjust the 78 <envar>PREFIX</envar> variable according to your specific subnet.</para> 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 && 56 cat > /etc/network.d/interface.eth0 << "EOF" 57 <literal># Network Interface Configuration 58 59 # network device name 60 INTERFACE=eth0 61 62 # set to yes to use DHCP instead of the settings below 63 DHCP=no 64 65 # IP address 66 IPADDRESS=192.168.1.2 67 68 # netmask 69 NETMASK=255.255.255.0 70 71 # broadcast address 72 BROADCAST=192.168.1.255</literal> 73 EOF</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> 79 90 80 91 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.