1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="ch-network-static">
|
---|
9 | <?dbhtml filename="network-static.html"?>
|
---|
10 |
|
---|
11 | <title>Static Networking Configuration</title>
|
---|
12 |
|
---|
13 | <sect2>
|
---|
14 | <title>Creating the Static Network Interface Configuration Files</title>
|
---|
15 |
|
---|
16 | <para>Which interfaces are brought up and down by the network script
|
---|
17 | depends on the files and directories in the <filename
|
---|
18 | class="directory">/etc/sysconfig/network-devices</filename> hierarchy.
|
---|
19 | This directory should contain a sub-directory for each interface to be
|
---|
20 | configured, such as <filename>ifconfig.xyz</filename>, where
|
---|
21 | <quote>xyz</quote> is a network interface name. Inside this directory
|
---|
22 | would be files defining the attributes to this interface, such as its IP
|
---|
23 | address(es), subnet masks, and so forth.</para>
|
---|
24 |
|
---|
25 | <para>The following command creates a sample <filename>ipv4</filename>
|
---|
26 | file for the <emphasis>eth0</emphasis> device:</para>
|
---|
27 |
|
---|
28 | <screen role="nodump"><userinput>cd /etc/sysconfig/network-devices &&
|
---|
29 | mkdir -v ifconfig.eth0 &&
|
---|
30 | cat > ifconfig.eth0/ipv4 << "EOF"
|
---|
31 | <literal>ONBOOT="yes"
|
---|
32 | SERVICE="ipv4-static"
|
---|
33 | IP="192.168.1.1"
|
---|
34 | GATEWAY="192.168.1.2"
|
---|
35 | PREFIX="24"
|
---|
36 | BROADCAST="192.168.1.255"</literal>
|
---|
37 | EOF</userinput></screen>
|
---|
38 |
|
---|
39 | <para os="var-ob">The values of these variables must be changed in every file to match
|
---|
40 | the proper setup. If the <envar>ONBOOT</envar> variable is set to
|
---|
41 | <quote>yes</quote> the network script will bring up the Network Interface
|
---|
42 | Card (NIC) during booting of the system. If set to anything but
|
---|
43 | <quote>yes</quote> the NIC will be ignored by the network script and not
|
---|
44 | be brought up.</para>
|
---|
45 |
|
---|
46 | <para os="var-s">The <envar>SERVICE</envar> variable defines the method used for
|
---|
47 | obtaining the IP address. The CLFS-Bootscripts package has a modular IP
|
---|
48 | assignment format, and creating additional files in the <filename
|
---|
49 | class="directory">/etc/sysconfig/network-devices/services</filename>
|
---|
50 | directory allows other IP assignment methods.</para>
|
---|
51 |
|
---|
52 | <para>The <envar>GATEWAY</envar> variable should contain the default
|
---|
53 | gateway IP address, if one is present. If not, then comment out the
|
---|
54 | variable entirely.</para>
|
---|
55 |
|
---|
56 | <para>The <envar>PREFIX</envar> variable needs to contain the number of
|
---|
57 | bits used in the subnet. Each octet in an IP address is 8 bits. If the
|
---|
58 | subnet's netmask is 255.255.255.0, then it is using the first three octets
|
---|
59 | (24 bits) to specify the network number. If the netmask is 255.255.255.240,
|
---|
60 | it would be using the first 28 bits. Prefixes longer than 24 bits are
|
---|
61 | commonly used by DSL and cable-based Internet Service Providers (ISPs).
|
---|
62 | In this example (PREFIX=24), the netmask is 255.255.255.0. Adjust the
|
---|
63 | <envar>PREFIX</envar> variable according to your specific subnet.</para>
|
---|
64 |
|
---|
65 | <para>To configure another DHCP Interface, Follow <xref linkend="conf-dhcpcd"/>.</para>
|
---|
66 |
|
---|
67 | </sect2>
|
---|
68 |
|
---|
69 | </sect1>
|
---|