blob: c7cba5629878fcc5718a3c3ec92d006ee1d20249 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<sect1 id="ch07-network">
<title>Configuring the network script</title>
<?dbhtml filename="network.html" dir="chapter07"?>
<para>This section only applies if you're going to configure a network
card.</para>
<sect2>
<title>Configuring default gateway</title>
<para>If you're on a network you may need to setup the default gateway for
this machine. This is done by adding the proper values to the
/etc/sysconfig/network file by running the following:</para>
<para><screen><userinput>cat >> /etc/sysconfig/network << "EOF"</userinput>
GATEWAY=192.168.1.2
GATEWAY_IF=eth0
<userinput>EOF</userinput></screen></para>
<para>The values for GATEWAY and GATEWAY_IF need to be changed to match
your network setup. GATEWAY contains the IP address of the default
gateway, and GATEWAY_IF contains the network interface through which the
default gateway can be reached.</para>
</sect2>
<sect2>
<title>Creating network interface configuration files</title>
<para>Which interfaces are brought up and down by the network script depends on
the files in the /etc/sysconfig/network-devices directory. This
directory should contain files in the form of ifconfig.xyz, where xyz is a
network interface name (such as eth0 or eth0:1)</para>
<para>We also need to add this directory path to the /etc/sysconfig/rc file
so that other scripts (like ifup and ifdown) know where this directory is
located.</para>
<para>Update the /etc/sysconfig/rc file by running:</para>
<para><screen><userinput>echo "network_devices=/etc/sysconfig/network-devices" >> /etc/sysconfig/rc</userinput></screen></para>
<para>Now, new files are created in that directory containing the following.
The following command creates a sample ifconfig.eth0 file:</para>
<para><screen><userinput>cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"</userinput>
ONBOOT=yes
IP=192.168.1.1
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
<userinput>EOF</userinput></screen></para>
<para>Of course, the values of those variables have to be changed
in every file to match the proper setup. If the ONBOOT variable is set
to yes, the network script will bring it up during boot up of the system.
If set to anything else but yes it will be ignored by the network script
and thus not brought up.</para>
</sect2>
</sect1>
|