source: connect/dhcp/bootscripts.xml@ 01600b9

10.0 10.1 11.0 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk upgradedb v1_0 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 01600b9 was 3d60760, checked in by Larry Lawrence <larry@…>, 19 years ago

added perl modules page

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@360 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 2.8 KB
Line 
1<sect1 id="dhcpclient" xreflabel="Configuring the LFS bootscripts to support DHCP clients">
2<?dbhtml filename="configdhcp.html" dir="connect"?>
3<title>Configuring the LFS bootscripts to support DHCP clients</title>
4
5<sect2><title>Config files</title>
6<para><userinput>/etc/sysconfig/network,
7/etc/sysconfig/network-devices/ifup-eth0,
8/etc/sysconfig/network-devices/ifdown-eth0,
9/etc/sysconfig/network-devices/ifconfig.eth0</userinput></para>
10</sect2>
11
12<sect2><title>Configuration Information</title>
13
14<para>Note that on this and the following pages, we
15use <userinput>eth0</userinput> as the example interface.
16If you want to configure a different (or more than one) interface, simply
17replace <userinput>eth0</userinput> with the interface you wish to use.</para>
18
19<para>These instructions will convert the configuration files from LFS
20(a static configuration) to a configuration using the DHCP protocol.
21Note that static and DHCP-based interfaces can co-exist on a LFS system. To
22do this, you should only make the alterations to those interfaces which
23need to support DHCP. All of the instructions on this page are applicable
24no matter which DHCP client you intend to use.</para>
25
26<para>If the interface you intend to use as your default gateway is going to
27use DHCP, the first step is to remove the GATEWAY and GATEWAY_IF variables
28from <filename>/etc/sysconfig/network</filename>. This will only need to be
29done once.</para>
30
31<para><screen><userinput>cd /etc/sysconfig &amp;&amp;
32cp network network.bak &amp;&amp;
33sed "s/GATEWAY/# GATEWAY/" network.bak > network</userinput></screen></para>
34
35<para>You then need to create scripts which will override the default
36network scripts and provide DHCP support. These two scripts are generic and
37so for use with both DHCP clients. First, the
38<filename>ifup-eth0</filename> script:</para>
39
40<para><screen><userinput>cat &gt; /etc/sysconfig/network-devices/ifup-eth0 &lt;&lt; "EOF" </userinput>
41#!/bin/sh
42
43source /etc/sysconfig/rc || exit
44source $rc_functions || exit
45source $network_devices/ifconfig.eth0 || exit
46
47echo "Bringing up the eth0 interface..."
48modprobe eth0
49loadproc $DHCP_PROG $DHCP_START
50<userinput>EOF</userinput></screen></para>
51
52<para>Then the <filename>ifdown-eth0</filename> script:</para>
53
54<para><screen><userinput>cat &gt; /etc/sysconfig/network-devices/ifdown-eth0 &lt;&lt; "EOF" </userinput>
55#!/bin/sh
56
57source /etc/sysconfig/rc || exit
58source $rc_functions || exit
59source $network_devices/ifconfig.eth0 || exit
60
61echo "Bringing down the eth0 interface..."
62$DHCP_PROG $DHCP_STOP
63evaluate_retval
64<userinput>EOF</userinput></screen></para>
65
66<para>Finally, we need to make these scripts executable:</para>
67
68<para><screen><userinput>chmod 755 /etc/sysconfig/network-devices/ifup-eth0 &amp;&amp;
69chmod 755 /etc/sysconfig/network-devices/ifdown-eth0</userinput></screen></para>
70
71</sect2>
72
73</sect1>
74
Note: See TracBrowser for help on using the repository browser.