aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07/network.xml
blob: 44e5ad01b5ad1a4f49bfd6e5e5f04640b1bf31e1 (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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>
<sect1 id="ch-scripts-network">
<title>Configuring the network script</title>
<?dbhtml filename="network.html"?>

<indexterm zone="ch-scripts-network">
<primary sortas="d-network">network</primary>
<secondary>configuring</secondary></indexterm>

<sect2>
<title>Creating network interface configuration files</title>

<para>The following command creates a sample <filename>ipv4</filename> file for the
<filename>eth0</filename> device:</para>

<screen><userinput>cd /etc/sysconfig/network-devices &amp;&amp;
mkdir ifconfig.eth0 &amp;&amp;
cat &gt; ifconfig.eth0/ipv4 &lt;&lt; "EOF"
ONBOOT=yes
SERVICE=ipv4-static
IP=192.168.1.1
GATEWAY=192.168.1.2
PREFIX=24
BROADCAST=192.168.1.255
EOF</userinput></screen>

</sect2>

<sect2 id="resolv.conf">
<title>Creating the /etc/resolv.conf file</title>
<indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm>

<para>Create the file by running the following:</para>

<screen><userinput>cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
# Begin /etc/resolv.conf

domain {<replaceable>[Your Domain Name]</replaceable>}
nameserver <replaceable>[IP address of your nameserver]</replaceable>

# End /etc/resolv.conf
EOF</userinput></screen>

</sect2>

</sect1>