source: chapter07/network.xml@ 6547aa1

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

added not to network config page to remove the network symlinks if no NIC present

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

  • Property mode set to 100644
File size: 2.4 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<para>If you don't have any network cards, you are most likely not going to
9create any configuration files relating to network cards. If that is the
10case, you must remove the <filename>network</filename> symlinks from all the
11runlevel directories
12(<filename class="directory">/etc/rc.d/rc*.d</filename>)</para>
13
14<sect2>
15<title>Configuring default gateway</title>
16
17<para>If you're on a network you may need to setup the default gateway for
18this machine. This is done by adding the proper values to the
19/etc/sysconfig/network file by running the following:</para>
20
21<para><screen><userinput>cat &gt;&gt; /etc/sysconfig/network &lt;&lt; "EOF"</userinput>
22GATEWAY=192.168.1.2
23GATEWAY_IF=eth0
24<userinput>EOF</userinput></screen></para>
25
26<para>The values for GATEWAY and GATEWAY_IF need to be changed to match
27your network setup. GATEWAY contains the IP address of the default
28gateway, and GATEWAY_IF contains the network interface through which the
29default gateway can be reached.</para>
30
31</sect2>
32
33<sect2>
34<title>Creating network interface configuration files</title>
35
36<para>Which interfaces are brought up and down by the network script depends on
37the files in the /etc/sysconfig/network-devices directory. This
38directory should contain files in the form of ifconfig.xyz, where xyz is a
39network interface name (such as eth0 or eth0:1)</para>
40
41<para>If you decide to rename or move this /etc/sysconfig/network-devices
42directory, make sure you update the /etc/sysconfig/rc file as well and
43update the network_devices by providing it with the new path.</para>
44
45<para>Now, new files are created in that directory containing the following.
46The following command creates a sample ifconfig.eth0 file:</para>
47
48<para><screen><userinput>cat &gt; /etc/sysconfig/network-devices/ifconfig.eth0 &lt;&lt; "EOF"</userinput>
49ONBOOT=yes
50IP=192.168.1.1
51NETMASK=255.255.255.0
52BROADCAST=192.168.1.255
53<userinput>EOF</userinput></screen></para>
54
55<para>Of course, the values of those variables have to be changed
56in every file to match the proper setup. If the ONBOOT variable is set
57to yes, the network script will bring it up during boot up of the system.
58If set to anything else but yes it will be ignored by the network script
59and thus not brought up.</para>
60
61</sect2>
62
63</sect1>
64
Note: See TracBrowser for help on using the repository browser.