source: chapter07/network.xml@ 1dfb7a1

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 1dfb7a1 was 1dfb7a1, checked in by Gerard Beekmans <gerard@…>, 22 years ago

dir name change for network script (from nic-config to network-devices)

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1446 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>First let's create this directory by running:</para>
36
37<para><screen><userinput>mkdir /etc/sysconfig/network-devices</userinput></screen></para>
38
39<para>Now, new files are created in that directory containing the following.
40The following command creates a sample ifconfig.eth0 file:</para>
41
42<para><screen><userinput>cat &gt; /etc/sysconfig/network-devices/ifconfig.eth0 &lt;&lt; "EOF"</userinput>
43ONBOOT=yes
44DEVICE=eth0
45IP=192.168.1.1
46NETMASK=255.255.255.0
47BROADCAST=192.168.1.255
48<userinput>EOF</userinput></screen></para>
49
50<para>Of course, the values of those variables have to be changed
51in every file to match the proper setup. Usually NETMASK and BROADCAST
52will remain the same, just the DEVICE and IP variables will change per
53network interface. If the ONBOOT variable is set to yes, the network script
54will bring it up during boot up of the system. If set to anything else but
55yes it will be ignored by the network script and thus not brought up.</para>
56
57</sect2>
58
59</sect1>
60
Note: See TracBrowser for help on using the repository browser.