source: chapter07/network.xml@ 3c8d339

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.0 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk v3_2 v3_3 v4_0 v4_1 v5_0 v5_1 v5_1_1 xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 3c8d339 was 3c8d339, checked in by Gerard Beekmans <gerard@…>, 22 years ago

updated to reflect new scripts

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1456 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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