Minimal Linux Installation - DHCP, DNS, Kickstart

Aims:

  • To perform additional tasks required during networked installation
  • To build on the minimal Unix system from last week
  • To add Network Infrastructure services - DHCP and DNS
  • To investigate automated installation and configuration using Kickstart

References:

LDP document on preparing to install Linux (Section 2)
Linux installation Datasheet (or your modifiied copy from last week's Tutorial exercise)
NetLab LabNotes
Linux Network Administrator's Guide (2nd Edition)
2.6 Resolving host Names
3.3 Configuring the Network Cards
4. Configuring TCP/IP networking
6. Name Service and Resolver configuration
LDP DHCPD Mini HOWTO
RedHat Linux 8.0 Customization Guide
Installing and Configuring a Minimal Fedora Server
 

Exercises:

The following exercise are to be conducted in each Tutorial group and is built on the Minimal Linux disk created in a previous  tutorial. In order to complete this exercise during the tutorial your group will need to be well prepared and not waste too much time. Your group will need:
  1. The same removable disk (from the TWO-series) that was allocated to your group in previous tutorials
  2. three or more neighbouring desktop PCs (one to be used as a server)
  3. a desktop hub and power pack
  4. a set of UTP network cables
  5. Fedora DVD
It is very important that each member of the group take detailed notes of the steps followed during this tutorial, as this will help to prevent errors and make it easier to repeat the correct procedure should you need to do so in future tutes. For example, it is entirely possible that you will need to reformat the hard disk and start again if there is some catastrophic error. Being able to refer back to detailed notes will make this a lot easier (:-).

Install DHCP service on your server

Refer back to your Linux Installation Datasheet and tutorial notes from last week.
This stage takes about 30-40 minutes and is described in Chapter 17 of the RedHat Linux Customization Guide.
In summary, you will need to:
  1. Using a local desktop hub, connect your nominated server and one or more other desktop machines into a local network using the second network interface (the one in the PC extension slot; not on the mainboard). Make sure that this network is isolated from the Lab network by unplugging all unnecessary UTP cables.
  2. Make sure the PC is SWITCHED OFF and plug in your group's allocated disk drive. After locking the drive in place and turning on the power, verify that the drive is recognised by the BIOS.
  3. Press the DEL key on the keyboard shortly after the first Beep during boot. This will open the BIOS configuration window. Confirm that the boot sequence is "A, CDROM, C" or some other combination where CDROM comes before C:
  4. Boot the Minimal Linux system from your hard disk and login as the root user (see last week's tutorial).
  5. Verify that the second network interface is configured and operational using the command /sbin/ifconfig eth1. If the interface is not available, then use the commands system-config-network to set up interface eth1, and service network restart to activate it. Since this machine is to be used as a server, the second network card should be confirured with a fixed network number, rather than using DHCP itself... it make no sense to configure the DHCP server using DHCP :-)
  6. Insert Fedora DVD in the CDROM drive and at the shell prompt enter the following commands:
  7. mount /media/cdrom
    cd /media/cdrom/Fedora/RPMS
    rpm -ivh dhcp-3<TAB>
  8. Create the DHCP configuration file in /etc/dhcpd.conf as described in Chapter 17. A sample file has been installed with the DHCP documentation and may be found at /usr/share/doc/dhcp-3.0pl1-9/dhcpd.conf.sample. A good suggestion is to replicate the IP assignments from the local network in the Lab, so that the benchtop machines may be used as clients in your private network without modification. A copy of the local lab DHCP configuration file is available here as a ZIP file.
  9. Create the DHCP lease database using the command: touch /var/lib/dhcp/dhcpd.leases
  10. Start the DHCP server using the command: /sbin/service dhcpd start. Watch carefully for any run-time or startup errors. These will also be recorded in the system logfile (/var/log/messages).
  11. To setup the system so that DHCP is started automatically at boot time use the command: ntsysv as described in Chapter 13. It may also be wise to configure the DHCP server so that it will only respond to requests arriving from the local network (ie at eth1). This prevents the server from answering DHCP requests from other networks and can be achieved by adding the line DHCPDARGS=eth1 to the service parameters in the file /etc/sysconfig/dhcpd.
  12. Test your server by booting a desktop computer connected to the same desktop network hub and configured as a DHCP client. Brief details of the DHCP request will be found afterwards in the servers system log file (/var/log/messages). Alternatively, setup a third machine with packet analyser software (EtherPeek, Ethereal or tcpdump) and watch for the DHCP request, offer and lease messages in the analyser packet trace.
  13. Things that may go wrong:
    1. faulty cables - discard any damaged cables, or cahles with broken RJ45 connectors
    2. cables not plugged in completely
    3. unconfigured network interfaces: verify configuration using /sbin/ifconfig
    4. NICs with static probed MAC addresses from another machine. This usually occurs in Fedora Core 4 or later, when the disk was formatted and System installed on another machine. The MAC address of the installation machine is registered in the driver software and will continue to be used even afer the disk is booted on a different PC (with a different MAC address!): Correct this fault by using the system-config-network utility and "probe" the MAC address to update it.
    5. DHCP configuration file with network details that differ from the local network configuration: If you downloaded a dhcpd.conf file, you must remember to correct the network addresses in the subnet and range options so that they correspond to the local network configuration
    6. not restarting the network services after editing and saving the configurations. Changes only com into effect after the services are restarted.
    7. enabling the Firewall or Security Enhanced Linux features. Firewalls or SE Linux may interfer with some network protocols and configurations. Verify firewall settings using /sbin/iptables -L to list the firewall rulesets. Edit the rule sets using the command /sbin/system-config-securitylevel.

Install DNS service on your server

  1. The Redhat Bind configuration tool is described in Chapter 20, and while this is a very convenient method for managing the DNS name lookup tables, it requires X-Windows, which may not be installed at this stage.
  2. See How DNS works for a description of the functions performed
  3. See Running named for a description of the configuration files required
  4. Installing BIND in your minimal Linux environment can be achieved by placing FedoraCore2 CD#1 in the CD drive and using the commands:
  5. mount /mnt/cdrom
    cd /mnt/cdrom/Fedora/RPMS
    rpm -ivh bind-*
  6. Then create the zone files. You may use any text editor to create the /etc/named.conf file or see Chapter 20 for details of the method using the redhat-config-bind command in X-Windows.
  7. Your Tutor may ask to see the working system and services and any notes take during the exercise.

Investigate the use of RedHat Kickstart to automatically install Linux and configure services

  1. RedHat Kickstart is described in Chapter 6 of the Customization Guide. There is also a useful article on Kickstart by James O'Kane in the SysAdmin Magazine.
  2. Consider what is required to setup a kickstart configuration to achieve all that you have done in the last two weeks. Your project may require the configuration of many Lunix systems, and the kickstart method may be a convenient way to achieve this automatically. Discuss.

Completing the Tutorial Exercise

Make sure that you clean up and reset the machinery before leaving the tutorial.
You should:
  1. logout and shutdown your machines correctly
  2. remove the B-series drive and return it to your Tutor for safe storage
  3. replace any desktop hubs and reconnect any cables that you used so that the desktop network setup is returned to its standard configuration. Remember that other students will be using the Lab after you, and have a care for the sort of environment they will find after you leave!!
  4. reinstall the ONE-series drive and make sure that the machine boots correctly, then shut it down correctly.
  5. Check with your tutor before leaving.