Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:repository_ausliefern_centos_6

Repository ausliefern CentOS 6

RPM (Package Manager) ist ein freies (GPL) Software-Paketverwaltungssystem, welches ursprünglich von ein prominenten Nord-Amerikanischen Linux-Distributor Red Hat entwickelt worden ist. Eine Sammlung von vielen RPM-Paketen stellt das sogenannte Repository dar, welches unter Zuhilfenahme eines Paket-Management Programms, wie z.B. YUM (Yellow Dog Updater) zur Aktualisierung von z.B. CentOS verwendet werden kann.

Ab hier werden zur Ausführung nachfolgender Befehle root-Rechte benötigt. Um der Benutzer root zu werden, melden Sie sich bitte als root-Benutzer am System an, oder wechseln mit nachfolgendem Befehl zum Benutzer root:

$ su -
Password:

Vorbereitungen

Nachfolgend soll beschrieben werden, wie z.B. ein gespiegeltes Repository - wie hier beschrieben:

auch als Installationsmethode/medium via PXE Boot als Installationsquelle genutzt werden kann.

Folgende technische Voraussetzungen müssen mindestens erfüllt werden:

  • Client-Netzwerkkarten müssen booten/starten via PXE (Preboot Execution Environment) unterstützen
  • Es muss ein DHCP-Server in/aus dem angeschlossenen Netzwerk erreichbar sein
  • Es muss ein TFTP-Server (Trivial File Transfer Protocol) in/aus dem angeschlossenen Netzwerk erreichbar sein

Installation

Zur Realisierung der Auslieferung eines gespiegelten Repositorys via PXE-Boot werden nachfolgende Pakete benötigt:

  • tftp-server - ist im base-Repository von CentOS
  • syslinux - ist im base-Repository von CentOS

Zusätzlich nachfolgende Komponenten, welche je nach Bedarf installiert werden:

  • nfs-utils - ist im base-Repository von CentOS

Die Installation und Konfiguration eines DHCP-Servers kann wie hier beschrieben erfolgen:

Mit nachfolgendem Befehl, werden die Pakete tftp-server, syslinux installiert:

# yum install tftp-server syslinux
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.de.leaseweb.net
 * extras: mirror.de.leaseweb.net
 * updates: mirror.de.leaseweb.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package syslinux.x86_64 0:3.86-1.1.el6 set to be updated
--> Processing Dependency: perl(Digest::SHA1) for package: syslinux-3.86-1.1.el6.x86_64
--> Processing Dependency: mtools for package: syslinux-3.86-1.1.el6.x86_64
--> Processing Dependency: perl(Crypt::PasswdMD5) for package: syslinux-3.86-1.1.el6.x86_64
---> Package tftp-server.x86_64 0:0.49-5.1.el6 set to be updated
--> Processing Dependency: xinetd for package: tftp-server-0.49-5.1.el6.x86_64
--> Running transaction check
---> Package mtools.x86_64 0:4.0.12-1.el6 set to be updated
---> Package perl-Crypt-PasswdMD5.noarch 0:1.3-6.el6 set to be updated
---> Package perl-Digest-SHA1.x86_64 0:2.12-2.el6 set to be updated
---> Package xinetd.x86_64 2:2.3.14-29.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                    Arch         Version               Repository  Size
================================================================================
Installing:
 syslinux                   x86_64       3.86-1.1.el6          base       928 k
 tftp-server                x86_64       0.49-5.1.el6          base        39 k
Installing for dependencies:
 mtools                     x86_64       4.0.12-1.el6          base       194 k
 perl-Crypt-PasswdMD5       noarch       1.3-6.el6             base        12 k
 perl-Digest-SHA1           x86_64       2.12-2.el6            base        49 k
 xinetd                     x86_64       2:2.3.14-29.el6       base       120 k

Transaction Summary
================================================================================
Install       6 Package(s)
Upgrade       0 Package(s)

Total download size: 1.3 M
Installed size: 3.3 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): mtools-4.0.12-1.el6.x86_64.rpm                    | 194 kB     00:00     
(2/6): perl-Crypt-PasswdMD5-1.3-6.el6.noarch.rpm         |  12 kB     00:00     
(3/6): perl-Digest-SHA1-2.12-2.el6.x86_64.rpm            |  49 kB     00:00     
(4/6): syslinux-3.86-1.1.el6.x86_64.rpm                  | 928 kB     00:01     
(5/6): tftp-server-0.49-5.1.el6.x86_64.rpm               |  39 kB     00:00     
(6/6): xinetd-2.3.14-29.el6.x86_64.rpm                   | 120 kB     00:00     
--------------------------------------------------------------------------------
Total                                           510 kB/s | 1.3 MB     00:02     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : mtools-4.0.12-1.el6.x86_64                               1/6 
  Installing     : perl-Digest-SHA1-2.12-2.el6.x86_64                       2/6 
  Installing     : 2:xinetd-2.3.14-29.el6.x86_64                            3/6 
  Installing     : perl-Crypt-PasswdMD5-1.3-6.el6.noarch                    4/6 
  Installing     : syslinux-3.86-1.1.el6.x86_64                             5/6 
  Installing     : tftp-server-0.49-5.1.el6.x86_64                          6/6 

Installed:
  syslinux.x86_64 0:3.86-1.1.el6        tftp-server.x86_64 0:0.49-5.1.el6       

Dependency Installed:
  mtools.x86_64 0:4.0.12-1.el6          perl-Crypt-PasswdMD5.noarch 0:1.3-6.el6 
  perl-Digest-SHA1.x86_64 0:2.12-2.el6  xinetd.x86_64 2:2.3.14-29.el6           

Complete!

Mit nachfolgendem Befehl kann überprüft werden, welche Inhalte mit den Paket tftp-server installiert wurden.

# rpm -qil tftp-server
Name        : tftp-server                  Relocations: (not relocatable)
Version     : 0.49                              Vendor: CentOS
Release     : 5.1.el6                       Build Date: Wed 18 Aug 2010 11:44:33 PM CEST
Install Date: Wed 19 Oct 2011 01:34:43 PM CEST      Build Host: c6b2.bsys.dev.centos.org
Group       : System Environment/Daemons    Source RPM: tftp-0.49-5.1.el6.src.rpm
Size        : 58742                            License: BSD
Signature   : RSA/8, Sun 03 Jul 2011 07:03:43 AM CEST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://www.kernel.org/pub/software/network/tftp/
Summary     : The server for the Trivial File Transfer Protocol (TFTP)
Description :
The Trivial File Transfer Protocol (TFTP) is normally used only for
booting diskless workstations.  The tftp-server package provides the
server for TFTP, which allows users to transfer files to and from a
remote machine. TFTP provides very little security, and should not be
enabled unless it is expressly needed.  The TFTP server is run from
/etc/xinetd.d/tftp, and is disabled by default.
/etc/xinetd.d/tftp
/usr/sbin/in.tftpd
/usr/share/doc/tftp-server-0.49
/usr/share/doc/tftp-server-0.49/CHANGES
/usr/share/doc/tftp-server-0.49/README
/usr/share/doc/tftp-server-0.49/README.security
/usr/share/doc/tftp-server-0.49/README.security.tftpboot
/usr/share/man/man8/in.tftpd.8.gz
/usr/share/man/man8/tftpd.8.gz
/var/lib/tftpboot

Mit nachfolgendem Befehl kann überprüft werden, welche Inhalte mit den Paket syslinux installiert wurden.

# rpm -qil syslinux
Name        : syslinux                     Relocations: (not relocatable)
Version     : 3.86                              Vendor: CentOS
Release     : 1.1.el6                       Build Date: Wed 18 May 2011 06:44:12 AM CEST
Install Date: Wed 19 Oct 2011 01:34:41 PM CEST      Build Host: c6b6.bsys.dev.centos.org
Group       : Applications/System           Source RPM: syslinux-3.86-1.1.el6.src.rpm
Size        : 2663825                          License: GPLv2+
Signature   : RSA/8, Sun 03 Jul 2011 07:02:39 AM CEST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://syslinux.zytor.com/
Summary     : Simple kernel loader which boots from a FAT filesystem
Description :
SYSLINUX is a suite of bootloaders, currently supporting DOS FAT
filesystems, Linux ext2/ext3 filesystems (EXTLINUX), PXE network boots
(PXELINUX), or ISO 9660 CD-ROMs (ISOLINUX).  It also includes a tool,
MEMDISK, which loads legacy operating systems from these media.
/sbin/extlinux
/usr/bin/gethostip
/usr/bin/isohybrid
/usr/bin/keytab-lilo
/usr/bin/lss16toppm
/usr/bin/md5pass
/usr/bin/mkdiskimage
/usr/bin/ppmtolss16
/usr/bin/pxelinux-options
/usr/bin/sha1pass
/usr/bin/syslinux
/usr/bin/syslinux2ansi
/usr/share/doc/syslinux-3.86
/usr/share/doc/syslinux-3.86/COPYING
/usr/share/doc/syslinux-3.86/CodingStyle.txt
/usr/share/doc/syslinux-3.86/NEWS
/usr/share/doc/syslinux-3.86/README
/usr/share/doc/syslinux-3.86/SubmittingPatches.txt
/usr/share/doc/syslinux-3.86/TODO
/usr/share/doc/syslinux-3.86/comboot.txt
/usr/share/doc/syslinux-3.86/distrib.txt
/usr/share/doc/syslinux-3.86/extlinux.txt
/usr/share/doc/syslinux-3.86/gpt.txt
/usr/share/doc/syslinux-3.86/isolinux.txt
/usr/share/doc/syslinux-3.86/keytab-lilo.txt
/usr/share/doc/syslinux-3.86/mboot.txt
/usr/share/doc/syslinux-3.86/memdisk.txt
/usr/share/doc/syslinux-3.86/menu.txt
/usr/share/doc/syslinux-3.86/pxelinux.txt
/usr/share/doc/syslinux-3.86/rfc5071.txt
/usr/share/doc/syslinux-3.86/sample
/usr/share/doc/syslinux-3.86/sample/Makefile
/usr/share/doc/syslinux-3.86/sample/README
/usr/share/doc/syslinux-3.86/sample/atou.c
/usr/share/doc/syslinux-3.86/sample/c32echo.c
/usr/share/doc/syslinux-3.86/sample/c32echo.c32
/usr/share/doc/syslinux-3.86/sample/c32entry.S
/usr/share/doc/syslinux-3.86/sample/c32exit.S
/usr/share/doc/syslinux-3.86/sample/comecho.asm
/usr/share/doc/syslinux-3.86/sample/comecho.com
/usr/share/doc/syslinux-3.86/sample/conio.c
/usr/share/doc/syslinux-3.86/sample/fd.c
/usr/share/doc/syslinux-3.86/sample/fd.c32
/usr/share/doc/syslinux-3.86/sample/filetest.c
/usr/share/doc/syslinux-3.86/sample/filetest.c32
/usr/share/doc/syslinux-3.86/sample/hello.c
/usr/share/doc/syslinux-3.86/sample/hello.c32
/usr/share/doc/syslinux-3.86/sample/hello2.c
/usr/share/doc/syslinux-3.86/sample/hello2.c32
/usr/share/doc/syslinux-3.86/sample/m16-640x640-syslinux.jpg
/usr/share/doc/syslinux-3.86/sample/printf.c
/usr/share/doc/syslinux-3.86/sample/sample.msg
/usr/share/doc/syslinux-3.86/sample/skipatou.c
/usr/share/doc/syslinux-3.86/sample/syslinux_splash.jpg
/usr/share/doc/syslinux-3.86/sample/syslogo.lss
/usr/share/doc/syslinux-3.86/sample/syslogo.ppm.gz
/usr/share/doc/syslinux-3.86/sdi.txt
/usr/share/doc/syslinux-3.86/syslinux.txt
/usr/share/doc/syslinux-3.86/usbkey.txt
/usr/share/man/man1/extlinux.1.gz
/usr/share/man/man1/gethostip.1.gz
/usr/share/man/man1/lss16toppm.1.gz
/usr/share/man/man1/ppmtolss16.1.gz
/usr/share/man/man1/syslinux.1.gz
/usr/share/man/man1/syslinux2ansi.1.gz
/usr/share/syslinux
/usr/share/syslinux/altmbr.bin
/usr/share/syslinux/altmbr_c.bin
/usr/share/syslinux/altmbr_f.bin
/usr/share/syslinux/chain.c32
/usr/share/syslinux/cmd.c32
/usr/share/syslinux/com32
/usr/share/syslinux/com32/com32.ld
/usr/share/syslinux/com32/include
/usr/share/syslinux/com32/include/alloca.h
/usr/share/syslinux/com32/include/assert.h
/usr/share/syslinux/com32/include/bitsize
/usr/share/syslinux/com32/include/bitsize/limits.h
/usr/share/syslinux/com32/include/bitsize/stddef.h
/usr/share/syslinux/com32/include/bitsize/stdint.h
/usr/share/syslinux/com32/include/bitsize/stdintconst.h
/usr/share/syslinux/com32/include/bitsize/stdintlimits.h
/usr/share/syslinux/com32/include/colortbl.h
/usr/share/syslinux/com32/include/com32.h
/usr/share/syslinux/com32/include/console.h
/usr/share/syslinux/com32/include/cpufeature.h
/usr/share/syslinux/com32/include/ctype.h
/usr/share/syslinux/com32/include/dev.h
/usr/share/syslinux/com32/include/dirent.h
/usr/share/syslinux/com32/include/dprintf.h
/usr/share/syslinux/com32/include/elf.h
/usr/share/syslinux/com32/include/endian.h
/usr/share/syslinux/com32/include/errno.h
/usr/share/syslinux/com32/include/fcntl.h
/usr/share/syslinux/com32/include/gplinclude
/usr/share/syslinux/com32/include/gplinclude/README
/usr/share/syslinux/com32/include/gplinclude/cpuid.h
/usr/share/syslinux/com32/include/gplinclude/disk
/usr/share/syslinux/com32/include/gplinclude/disk/bootloaders.h
/usr/share/syslinux/com32/include/gplinclude/disk/common.h
/usr/share/syslinux/com32/include/gplinclude/disk/errno_disk.h
/usr/share/syslinux/com32/include/gplinclude/disk/error.h
/usr/share/syslinux/com32/include/gplinclude/disk/geom.h
/usr/share/syslinux/com32/include/gplinclude/disk/mbrs.h
/usr/share/syslinux/com32/include/gplinclude/disk/msdos.h
/usr/share/syslinux/com32/include/gplinclude/disk/partition.h
/usr/share/syslinux/com32/include/gplinclude/disk/read.h
/usr/share/syslinux/com32/include/gplinclude/disk/swsusp.h
/usr/share/syslinux/com32/include/gplinclude/disk/util.h
/usr/share/syslinux/com32/include/gplinclude/disk/write.h
/usr/share/syslinux/com32/include/gplinclude/dmi
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_base_board.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_battery.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_bios.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_cache.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_chassis.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_ipmi.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_memory.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_processor.h
/usr/share/syslinux/com32/include/gplinclude/dmi/dmi_system.h
/usr/share/syslinux/com32/include/gplinclude/memory.h
/usr/share/syslinux/com32/include/gplinclude/vpd
/usr/share/syslinux/com32/include/gplinclude/vpd/vpd.h
/usr/share/syslinux/com32/include/inttypes.h
/usr/share/syslinux/com32/include/klibc
/usr/share/syslinux/com32/include/klibc/archsetjmp.h
/usr/share/syslinux/com32/include/klibc/compiler.h
/usr/share/syslinux/com32/include/klibc/diverr.h
/usr/share/syslinux/com32/include/klibc/endian.h
/usr/share/syslinux/com32/include/klibc/extern.h
/usr/share/syslinux/com32/include/klibc/sysconfig.h
/usr/share/syslinux/com32/include/libansi.h
/usr/share/syslinux/com32/include/limits.h
/usr/share/syslinux/com32/include/math.h
/usr/share/syslinux/com32/include/minmax.h
/usr/share/syslinux/com32/include/netinet
/usr/share/syslinux/com32/include/netinet/in.h
/usr/share/syslinux/com32/include/png.h
/usr/share/syslinux/com32/include/pngconf.h
/usr/share/syslinux/com32/include/setjmp.h
/usr/share/syslinux/com32/include/stdarg.h
/usr/share/syslinux/com32/include/stdbool.h
/usr/share/syslinux/com32/include/stddef.h
/usr/share/syslinux/com32/include/stdint.h
/usr/share/syslinux/com32/include/stdio.h
/usr/share/syslinux/com32/include/stdlib.h
/usr/share/syslinux/com32/include/string.h
/usr/share/syslinux/com32/include/sys
/usr/share/syslinux/com32/include/sys/cpu.h
/usr/share/syslinux/com32/include/sys/elf32.h
/usr/share/syslinux/com32/include/sys/elf64.h
/usr/share/syslinux/com32/include/sys/elfcommon.h
/usr/share/syslinux/com32/include/sys/fpu.h
/usr/share/syslinux/com32/include/sys/gpxe.h
/usr/share/syslinux/com32/include/sys/io.h
/usr/share/syslinux/com32/include/sys/pci.h
/usr/share/syslinux/com32/include/sys/stat.h
/usr/share/syslinux/com32/include/sys/time.h
/usr/share/syslinux/com32/include/sys/times.h
/usr/share/syslinux/com32/include/sys/types.h
/usr/share/syslinux/com32/include/syslinux
/usr/share/syslinux/com32/include/syslinux/adv.h
/usr/share/syslinux/com32/include/syslinux/advconst.h
/usr/share/syslinux/com32/include/syslinux/align.h
/usr/share/syslinux/com32/include/syslinux/boot.h
/usr/share/syslinux/com32/include/syslinux/bootpm.h
/usr/share/syslinux/com32/include/syslinux/bootrm.h
/usr/share/syslinux/com32/include/syslinux/config.h
/usr/share/syslinux/com32/include/syslinux/features.h
/usr/share/syslinux/com32/include/syslinux/idle.h
/usr/share/syslinux/com32/include/syslinux/io.h
/usr/share/syslinux/com32/include/syslinux/keyboard.h
/usr/share/syslinux/com32/include/syslinux/linux.h
/usr/share/syslinux/com32/include/syslinux/loadfile.h
/usr/share/syslinux/com32/include/syslinux/memscan.h
/usr/share/syslinux/com32/include/syslinux/movebits.h
/usr/share/syslinux/com32/include/syslinux/pxe.h
/usr/share/syslinux/com32/include/syslinux/reboot.h
/usr/share/syslinux/com32/include/syslinux/resolve.h
/usr/share/syslinux/com32/include/syslinux/vesacon.h
/usr/share/syslinux/com32/include/syslinux/video.h
/usr/share/syslinux/com32/include/syslinux/zio.h
/usr/share/syslinux/com32/include/time.h
/usr/share/syslinux/com32/include/tinyjpeg.h
/usr/share/syslinux/com32/include/unistd.h
/usr/share/syslinux/com32/include/zconf.h
/usr/share/syslinux/com32/include/zlib.h
/usr/share/syslinux/com32/libcom32.a
/usr/share/syslinux/com32/libcom32gpl.a
/usr/share/syslinux/com32/libutil_com.a
/usr/share/syslinux/com32/libutil_lnx.a
/usr/share/syslinux/config.c32
/usr/share/syslinux/cpuid.c32
/usr/share/syslinux/cpuidtest.c32
/usr/share/syslinux/disk.c32
/usr/share/syslinux/dmitest.c32
/usr/share/syslinux/dosutil
/usr/share/syslinux/dosutil/copybs.com
/usr/share/syslinux/dosutil/eltorito.sys
/usr/share/syslinux/dosutil/mdiskchk.com
/usr/share/syslinux/elf.c32
/usr/share/syslinux/ethersel.c32
/usr/share/syslinux/gfxboot.c32
/usr/share/syslinux/gfxboot.com
/usr/share/syslinux/gptmbr.bin
/usr/share/syslinux/gptmbr_c.bin
/usr/share/syslinux/gptmbr_f.bin
/usr/share/syslinux/gpxecmd.c32
/usr/share/syslinux/gpxelinux.0
/usr/share/syslinux/hdt.c32
/usr/share/syslinux/ifcpu.c32
/usr/share/syslinux/ifcpu64.c32
/usr/share/syslinux/int18.com
/usr/share/syslinux/isohdpfx.bin
/usr/share/syslinux/isohdpfx_c.bin
/usr/share/syslinux/isohdpfx_f.bin
/usr/share/syslinux/isohdppx.bin
/usr/share/syslinux/isohdppx_c.bin
/usr/share/syslinux/isohdppx_f.bin
/usr/share/syslinux/isolinux-debug.bin
/usr/share/syslinux/isolinux.bin
/usr/share/syslinux/kbdmap.c32
/usr/share/syslinux/linux.c32
/usr/share/syslinux/mboot.c32
/usr/share/syslinux/mbr.bin
/usr/share/syslinux/mbr_c.bin
/usr/share/syslinux/mbr_f.bin
/usr/share/syslinux/memdisk
/usr/share/syslinux/memdump.com
/usr/share/syslinux/meminfo.c32
/usr/share/syslinux/menu.c32
/usr/share/syslinux/pcitest.c32
/usr/share/syslinux/pmload.c32
/usr/share/syslinux/poweroff.com
/usr/share/syslinux/pxechain.com
/usr/share/syslinux/pxelinux.0
/usr/share/syslinux/reboot.c32
/usr/share/syslinux/rosh.c32
/usr/share/syslinux/sanboot.c32
/usr/share/syslinux/sdi.c32
/usr/share/syslinux/sysdump.c32
/usr/share/syslinux/syslinux.com
/usr/share/syslinux/syslinux.exe
/usr/share/syslinux/vesainfo.c32
/usr/share/syslinux/vesamenu.c32
/usr/share/syslinux/vpdtest.c32

iptables Regel

Damit der xinetd/tftp Dienst/Daemon auch erreichbar ist und nicht die Auslieferung der rpm-Pakete vom Paketfilter iptables blockiert werden, muss nachfolgende Regeln zum iptables-Regelwerk hinzugefügt werden.

Um die aktuellen iptables-Regeln erweitern zu können, sollten diese erst einmal aufgelistet werden, was mit nachfolgendem Befehl durchgeführt werden kann:

# iptables -L -nv --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1    3310K 4734M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
2        0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           
3        0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
4        3   180 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22 
5      158  5056 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1        0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT 1654K packets, 151M bytes)
num   pkts bytes target     prot opt in     out     source               destination

Nachfolgender Befehl, fügt folgende iptables-Regeln dem iptables-Regelwerk nach der Position 4 hinzu, ohne das der Paketfilter angehalten werden muss:

  • -A INPUT -p udp --dport 69 -j ACCEPT
  • -A INPUT -p tcp --dport 111 -j ACCEPT
  • -A INPUT -p udp --dport 111 -j ACCEPT
  • -A INPUT -p tcp --dport 892 -j ACCEPT
  • -A INPUT -p tcp --dport 2049 -j ACCEPT
  • -A INPUT -p udp --dport 2049 -j ACCEPT

und hier die Befehle:

# iptables -I INPUT 5 -p udp --dport 69 -j ACCEPT
# iptables -I INPUT 6 -p tcp --dport 111 -j ACCEPT
# iptables -I INPUT 7 -p udp --dport 111 -j ACCEPT
# iptables -I INPUT 8 -p tcp --dport 892 -j ACCEPT
# iptables -I INPUT 9 -p tcp --dport 2049 -j ACCEPT
# iptables -I INPUT 10 -p udp --dport 2049 -j ACCEPT

Ein erneute Abfrage des iptables-Regelwerts, sollte dann nachfolgend dargestellte Ausgabe ergeben, was mit folgendem Befehl durchgeführt werden kann:

]# iptables -L -nv --line-numbers
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1       30  2208 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
2        0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           
3        0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
4        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22 
5        0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:69
6        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:111
7        0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:111
8        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:892  
9        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:2049 
10       0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:2049 
11       0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1        0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT 4 packets, 592 bytes)
num   pkts bytes target     prot opt in     out     source               destination

Die neuen Zeilen sind an Position 5 (INPUT), Position 6 (INPUT), Position 7 (INPUT), Position 8 (INPUT) und Position 9 (INPUT) zu sehen, hier nachfolgend zur Verdeutlichung noch einmal dargestellt (nur relevanter Ausschnitt):

...
5        0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:69
6        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:111
7        0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:111
8        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:892  
9        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:2049 
10       0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:2049
...

Um diese iptables-Regel dauerhaft, auch nach einem Neustart des Server, weiterhin im iptables-Regelwerk zu speichern, muss nachfolgend dargestellter Befehl abschließend noch ausgeführt werden:

# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

Konfiguration

Um über den xinetd/tftp Dienst/Daemon die Auslieferung eines gespiegelten Repositorys via PXE-Boot zu realisieren, muss dem xinetd/tftp Dienst/Daemon die Fähigkeit gegeben werden, dem über PXE-Boot anfragendem System ein minimales Betriebssystem mit einem Auswahlmenü über das Netzwerk zu transferieren.

Benötigte Dateien

Durch das kopieren der nachfolgend genannten Dateien aus dem Verzeichnis

  • /usr/share/syslinux/pxelinux.0
  • /usr/share/syslinux/menu.c32
  • /usr/share/syslinux/vesamenu.c32
  • /usr/share/syslinux/memdisk
  • /usr/share/syslinux/mboot.c32
  • /usr/share/syslinux/chain.c32

in das Verzeichnis

  • /var/lib/tftpboot

kann ein minimales Betriebssystem mit einem Auswahlmenü über das Netzwerk transferiert werden.

Hier die benötigten Befehle zum kopieren der benötigten Dateien:

# cp -a /usr/share/syslinux/{pxelinux.0,menu.c32,vesamenu.c32,memdisk,mboot.c32,chain.c32} /var/lib/tftpboot

Des weiteren muss noch ein Verzeichnis erstellt werden, welche das Menü oder sogar die Menüs beinhaltet, die beim PXE-Boot angezeigt werden sollen, was mit nachfolgendem Befehl realisiert werden kann:

# mkdir /var/lib/tftpboot/pxelinux.cfg

Abschließend muss noch ein Verzeichnis erstellt werden, in dem die einzelnen Image-Dateien, welche beim Boot-Vorgang benötigt werden, durch nachfolgendem Befehl erstellt werden:

# mkdir /var/lib/tftpboot/images

Als Beispiel sollen hier das Betriebssystem CentOS in der Version 6.0 für die Architekturen 32-bit und 64-bit erstellt werden, was mit nachfolgenden Befehlen realisiert werden kann:

# mkdir -p /var/lib/tftpboot/images/centos/6.0/x86_64/
# mkdir -p /var/lib/tftpboot/images/centos/6.0/i386/

Nun könnten die benötigten Image-Dateien aus dem Verzeichnis, welche evtl. mit rsync transferiert wurden, müssen nun in das entsprechende Verzeichnis kopiert werden, wie es mit nachfolgenden Befehlen durchgeführt wird:

# cp /data/repository/pub/Mirrors/centos/6.0/os/x86_64/images/pxeboot/vmlinuz /var/lib/tftpboot/images/centos/6.0/x86_64/vmlinuz
# cp /data/repository/pub/Mirrors/centos/6.0/os/x86_64/images/pxeboot/initrd.img /var/lib/tftpboot/images/centos/6.0/x86_64/initrd.img
# cp /data/repository/pub/Mirrors/centos/6.0/os/i386/images/pxeboot/vmlinuz /var/lib/tftpboot/images/centos/6.0/i386/vmlinuz
# cp /data/repository/pub/Mirrors/centos/6.0/os/i386/images/pxeboot/initrd.img /var/lib/tftpboot/images/centos/6.0/i386/initrd.img

Boot-Menü erstellen

Um dem über PXE-Boot anfragendem System ein minimales Betriebssystem mit einem Auswahlmenü über das Netzwerk zu transferieren, muss ebenfalls eine Menü-Datei erstellt werden.

Um dies zu realisieren, ist vorab erst einmal eine Datei in nachfolgendem Verzeichnis mit nachfolgendem Namen zu erstellen

  • /var/lib/tftpboot/pxelinux.cfg/default

Boot Menü: Text

Der Inhalt dieser Konfigurationsdatei des anzuzeigenden Text-Auswahl, könnte wie nachfolgend dargestellt aussehen:

PROMPT 1
TIMEOUT 600
DISPLAY pxelinux.cfg/menumain.msg
F1 pxelinux.cfg/menumain.msg
 
DEFAULT localdisk
 
LABEL localdisk
        MENU LABEL Boot from local hard drive
        LOCALBOOT 0
 
LABEL centos60_x86_64
        MENU LABEL Install CentOS 6.0 64-bit
        KERNEL images/centos/6.0/x86_64/vmlinuz
        APPEND initrd=images/centos/6.0/x86_64/initrd.img ramdisk_size=128000
 
LABEL centos60_i386
        MENU LABEL Install CentOS 6.0 32-bit
        KERNEL images/centos/6.0/i386/vmlinuz
        APPEND initrd=images/centos/6.0/i386/initrd.img ramdisk_size=128000

Die tatsächliche Bildschirmdarstellung, sprich das eigentlich sichtbare Text-Auswahl, ist in nachfolgendem Verzeichnis mit nachfolgendem Dateinamen enthalten

  • /var/lib/tftpboot/pxelinux.cfg/menumain.cfg

Der Inhalt dieser Konfigurationsdatei der tatsächlichen Text-Auswahl, könnte wie nachfolgend dargestellt aussehen:

      PXE-Boot Main Menu
      -------------------------------------------------------------------   
 
        - Type "localdisk"             | Boot from local hard disk.
 
        - Type "centos60_x86_64"       | Install CentOS 6.0 64-bit.
        - Type "centos60_i386"         | Install CentOS 6.0 32-bit.
 
 
 
 
 
 
 
 
 
 
 
      -------------------------------------------------------------------   
       After a period of 60 seconds, a boot from local hard disk starts!
      -------------------------------------------------------------------
 
      [F1-Main]

Boot Menü: Menü

Der Inhalt dieser Konfigurationsdatei des anzuzeigenden Text-Menüs, könnte wie nachfolgend dargestellt aussehen:

TIMEOUT 600
DEFAULT menu.c32
 
MENU TITLE PXE Boot Menu
LABEL 1
        MENU LABEL ^1. Boot from local hard drive
        LOCALBOOT 0
 
MENU SEPARATOR
 
LABEL 2
        MENU LABEL ^2. Install CentOS 6.0 64-bit
        KERNEL images/centos/6.0/x86_64/vmlinuz
        APPEND initrd=images/centos/6.0/x86_64/initrd.img ramdisk_size=128000
 
LABEL 3
        MENU LABEL ^3. Install CentOS 6.0 32-bit
        KERNEL images/centos/6.0/i386/vmlinuz
        APPEND initrd=images/centos/6.0/i386/initrd.img ramdisk_size=128000

Das Aussehen des Text-Menüs, könnte wie nachfolgend dargestellt aussehen:

PXE Boot Menü - Menü

Boot Menü: grafisches Menü

Der Inhalt dieser Konfigurationsdatei des anzuzeigenden grafischen Menüs, könnte wie nachfolgend dargestellt aussehen:

TIMEOUT 600
DEFAULT vesamenu.c32
 
MENU TITLE PXE Boot Menu
MENU BACKGROUND pxelinux.cfg/centos6_default_640x480.png
 
LABEL 1
        MENU LABEL ^1. Boot from local hard drive
        LOCALBOOT 0
 
MENU SEPARATOR
 
LABEL 2
        MENU LABEL ^2. Install CentOS 6.0 64-bit
        KERNEL images/centos/6.0/x86_64/vmlinuz
        APPEND initrd=images/centos/6.0/x86_64/initrd.img ramdisk_size=128000
 
LABEL 3
        MENU LABEL ^3. Install CentOS 6.0 32-bit
        KERNEL images/centos/6.0/i386/vmlinuz
        APPEND initrd=images/centos/6.0/i386/initrd.img ramdisk_size=128000

Das Aussehen des grafischen Menüs, könnte wie nachfolgend dargestellt aussehen:

PXE Boot Menü - grafisches Menü

Boot-Menü erstellen: xinetd

:!: WICHTIG - Damit der xinetd/tftp-Server auch das Boot-Menü anzeigen kann, ist es erforderlich die DATEIRECHTE anzupassen !!!

Es müssen die Dateirechte ALLER sich im Verzeichnis

  • /var/lib/tftpboot/pxelinux.cfg

befindlichen Dateien, mit nachfolgendem Befehl wie folgt abgeändert werden:

# chmod 777 /var/lib/tftpboot/pxelinux.cfg/* 

Dienst/Deamon: xinetd

xinetd: Konfiguration

Um die Auslieferung eines gespiegelten Repositorys via PXE-Boot zu realisieren, muss dessen Komponente xinetd/tftp als Dienst/Deamon als Hintergrundprozess laufen. Dazu ist nachfolgende Konfiguration des xinetd/tftp Dienst/Demon notwendig.

Die Konfigurationsdatei, welche hierfür angepasst werden muss, ist unter folgendem Verzeichnis und mit nachfolgendem Namen zu finden:

  • /etc/xinet.d/tftp

Die durchzuführende Anpassung sieht wie folgt aus (komplette Konfigurationsdatei):

# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        # Tachtler
        # default: disable                      = yes
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

xinetd: Start einrichten

Um die Auslieferung eines gespiegelten Repositorys via PXE-Boot zu realisieren, muss dessen Komponente xinetd/tftp als Dienst/Deamon als Hintergrundprozess laufen. Um diesen Daemon/Dienst auch nach einem Neustart des Servers zur Verfügung zu haben, soll der Dienst/Daemon mit dem Server mit gestartet werden, was mit nachfolgendem Befehl realisiert werden kann:

# chkconfig xinetd on

Eine Überprüfung, ob beim Neustart des Server der xinetd/tftp-Dienst/Deamon wirklich mit gestartet wird, kann mit nachfolgendem Befehl erfolgen und sollte eine Anzeige, wie ebenfalls nachfolgend dargestellt ausgeben:

# chkconfig --list | tail -n 16
xinetd          0:off   1:off   2:on    3:on    4:on    5:on    6:off

xinetd based services:
        chargen-dgram:  off
        chargen-stream: off
        daytime-dgram:  off
        daytime-stream: off
        discard-dgram:  off
        discard-stream: off
        echo-dgram:     off
        echo-stream:    off
        rsync:          off
        tcpmux-server:  off
        tftp:           on
        time-dgram:     off
        time-stream:    off

xinetd: Starten

Um die Auslieferung eines gespiegelten Repositorys via PXE-Boot zu realisieren, muss dessen Komponente xinetd/tftp als Dienst/Deamon als Hintergrundprozess laufen. Um starten des xinetd/tftp als Dienst/Deamon kann nachfolgender Befehl verwendet werden:

# service xinetd start
Starting xinetd:                                           [  OK  ]

Eine einfache Überprüfung, ob der xinetd/tftp Dienst/Daemon auch wirklich gestartet ist, kann unter anderem mit nachfolgendem Befehl durchgeführt werden:

# netstat -tulpen | grep xinetd
udp        0      0 0.0.0.0:69                  0.0.0.0:*                               0          16416      2484/xinetd

Dienst/Deamon: nfs

Es gibt verschiedene Möglichkeiten die Auslieferung eines gespiegelten Repositorys via PXE-Boot zu realisieren. Eine dieser Möglichkeiten ist die Auslieferung der rpm-Pakete mittels eines NFS-Server.

nfs: Installation

Mit nachfolgendem Befehl, wird das Paket nfs-utils installiert:

# yum install nfs-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.de.leaseweb.net
 * extras: mirror.de.leaseweb.net
 * updates: mirror.de.leaseweb.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.2.2-7.el6 set to be updated
--> Processing Dependency: nfs-utils-lib >= 1.1.0-3 for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libgssglue for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: rpcbind for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libtirpc for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libgssglue.so.1(libgssapi_CITI_2)(64bit) for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libevent for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libevent-1.4.so.2()(64bit) for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libnfsidmap.so.0()(64bit) for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libtirpc.so.1()(64bit) for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Processing Dependency: libgssglue.so.1()(64bit) for package: 1:nfs-utils-1.2.2-7.el6.x86_64
--> Running transaction check
---> Package libevent.x86_64 0:1.4.13-1.el6 set to be updated
---> Package libgssglue.x86_64 0:0.1-8.1.el6 set to be updated
---> Package libtirpc.x86_64 0:0.2.1-1.el6 set to be updated
---> Package nfs-utils-lib.x86_64 0:1.1.5-1.el6 set to be updated
---> Package rpcbind.x86_64 0:0.2.0-8.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package               Arch           Version                Repository    Size
================================================================================
Installing:
 nfs-utils             x86_64         1:1.2.2-7.el6          base         296 k
Installing for dependencies:
 libevent              x86_64         1.4.13-1.el6           base          66 k
 libgssglue            x86_64         0.1-8.1.el6            base          23 k
 libtirpc              x86_64         0.2.1-1.el6            base          77 k
 nfs-utils-lib         x86_64         1.1.5-1.el6            base          66 k
 rpcbind               x86_64         0.2.0-8.el6            base          51 k

Transaction Summary
================================================================================
Install       6 Package(s)
Upgrade       0 Package(s)

Total download size: 578 k
Installed size: 1.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): libevent-1.4.13-1.el6.x86_64.rpm                  |  66 kB     00:00     
(2/6): libgssglue-0.1-8.1.el6.x86_64.rpm                 |  23 kB     00:00     
(3/6): libtirpc-0.2.1-1.el6.x86_64.rpm                   |  77 kB     00:00     
(4/6): nfs-utils-1.2.2-7.el6.x86_64.rpm                  | 296 kB     00:00     
(5/6): nfs-utils-lib-1.1.5-1.el6.x86_64.rpm              |  66 kB     00:00     
(6/6): rpcbind-0.2.0-8.el6.x86_64.rpm                    |  51 kB     00:00     
--------------------------------------------------------------------------------
Total                                           397 kB/s | 578 kB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libgssglue-0.1-8.1.el6.x86_64                            1/6 
  Installing     : libtirpc-0.2.1-1.el6.x86_64                              2/6 
  Installing     : rpcbind-0.2.0-8.el6.x86_64                               3/6 
  Installing     : libevent-1.4.13-1.el6.x86_64                             4/6 
  Installing     : nfs-utils-lib-1.1.5-1.el6.x86_64                         5/6 
  Installing     : 1:nfs-utils-1.2.2-7.el6.x86_64                           6/6 

Installed:
  nfs-utils.x86_64 1:1.2.2-7.el6                                                

Dependency Installed:
  libevent.x86_64 0:1.4.13-1.el6       libgssglue.x86_64 0:0.1-8.1.el6         
  libtirpc.x86_64 0:0.2.1-1.el6        nfs-utils-lib.x86_64 0:1.1.5-1.el6      
  rpcbind.x86_64 0:0.2.0-8.el6        

Complete!

Mit nachfolgendem Befehl kann überprüft werden, welche Inhalte mit den Paket nfs-utils installiert wurden.

# rpm -qil nfs-utils
Name        : nfs-utils                    Relocations: (not relocatable)
Version     : 1.2.2                             Vendor: CentOS
Release     : 7.el6                         Build Date: Fri 12 Nov 2010 10:19:14 AM CET
Install Date: Thu 20 Oct 2011 06:02:07 PM CEST      Build Host: c6b4.bsys.dev.centos.org
Group       : System Environment/Daemons    Source RPM: nfs-utils-1.2.2-7.el6.src.rpm
Size        : 804238                           License: MIT and GPLv2 and GPLv2+ and BSD
Signature   : RSA/8, Sun 03 Jul 2011 06:47:33 AM CEST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://sourceforge.net/projects/nfs
Summary     : NFS utilities and supporting clients and daemons for the kernel NFS server
Description :
The nfs-utils package provides a daemon for the kernel NFS server and
related tools, which provides a much higher level of performance than the
traditional Linux NFS server used by most users.

This package also contains the showmount program.  Showmount queries the
mount daemon on a remote host for information about the NFS (Network File
System) server on the remote host.  For example, showmount can display the
clients which are mounted on that host.

This package also contains the mount.nfs and umount.nfs program.
/etc/nfsmount.conf
/etc/rc.d/init.d/nfs
/etc/rc.d/init.d/nfslock
/etc/rc.d/init.d/rpcgssd
/etc/rc.d/init.d/rpcidmapd
/etc/rc.d/init.d/rpcsvcgssd
/etc/sysconfig/nfs
/sbin/mount.nfs
/sbin/mount.nfs4
/sbin/rpc.statd
/sbin/umount.nfs
/sbin/umount.nfs4
/usr/sbin/exportfs
/usr/sbin/gss_clnt_send_err
/usr/sbin/gss_destroy_creds
/usr/sbin/mountstats
/usr/sbin/nfsiostat
/usr/sbin/nfsstat
/usr/sbin/rpc.gssd
/usr/sbin/rpc.idmapd
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd
/usr/sbin/rpc.svcgssd
/usr/sbin/rpcdebug
/usr/sbin/showmount
/usr/sbin/sm-notify
/usr/sbin/start-statd
/usr/share/doc/nfs-utils-1.2.2
/usr/share/doc/nfs-utils-1.2.2/ChangeLog
/usr/share/doc/nfs-utils-1.2.2/INSTALL
/usr/share/doc/nfs-utils-1.2.2/KNOWNBUGS
/usr/share/doc/nfs-utils-1.2.2/Makefile
/usr/share/doc/nfs-utils-1.2.2/Makefile.am
/usr/share/doc/nfs-utils-1.2.2/Makefile.in
/usr/share/doc/nfs-utils-1.2.2/NEW
/usr/share/doc/nfs-utils-1.2.2/README
/usr/share/doc/nfs-utils-1.2.2/THANKS
/usr/share/doc/nfs-utils-1.2.2/TODO
/usr/share/man/man5/exports.5.gz
/usr/share/man/man5/nfs.5.gz
/usr/share/man/man5/nfsmount.conf.5.gz
/usr/share/man/man7/nfsd.7.gz
/usr/share/man/man8/exportfs.8.gz
/usr/share/man/man8/gssd.8.gz
/usr/share/man/man8/idmapd.8.gz
/usr/share/man/man8/mount.nfs.8.gz
/usr/share/man/man8/mount.nfs4.8.gz
/usr/share/man/man8/mountd.8.gz
/usr/share/man/man8/mountstats.8.gz
/usr/share/man/man8/nfsd.8.gz
/usr/share/man/man8/nfsiostat.8.gz
/usr/share/man/man8/nfsstat.8.gz
/usr/share/man/man8/rpc.gssd.8.gz
/usr/share/man/man8/rpc.idmapd.8.gz
/usr/share/man/man8/rpc.mountd.8.gz
/usr/share/man/man8/rpc.nfsd.8.gz
/usr/share/man/man8/rpc.sm-notify.8.gz
/usr/share/man/man8/rpc.statd.8.gz
/usr/share/man/man8/rpc.svcgssd.8.gz
/usr/share/man/man8/rpcdebug.8.gz
/usr/share/man/man8/showmount.8.gz
/usr/share/man/man8/sm-notify.8.gz
/usr/share/man/man8/statd.8.gz
/usr/share/man/man8/svcgssd.8.gz
/usr/share/man/man8/umount.nfs.8.gz
/usr/share/man/man8/umount.nfs4.8.gz
/var/lib/nfs
/var/lib/nfs/etab
/var/lib/nfs/rmtab
/var/lib/nfs/rpc_pipefs
/var/lib/nfs/statd
/var/lib/nfs/statd/sm
/var/lib/nfs/statd/sm.bak
/var/lib/nfs/state
/var/lib/nfs/v4recovery
/var/lib/nfs/xtab

nfs: Konfiguration

Um die Auslieferung eines gespiegelten Repositorys via NFS-Server zu realisieren, muss dessen Komponente nfs als Dienst/Deamon als Hintergrundprozess laufen. Dazu ist nachfolgende Konfiguration des nfs Dienst/Demon notwendig.

Die Konfigurationsdatei, welche hierfür angepasst werden muss, ist unter folgendem Verzeichnis und mit nachfolgendem Namen zu finden:

  • /etc/sysconfig/nfs

Die durchzuführende Anpassung sieht wie folgt aus (nur relevanter Ausschnitt):

...
# Port rpc.mountd should listen on.
# Tachtler
# default: #MOUNTD_PORT=892
MOUNTD_PORT=892
...

:!: WICHTIG - Diese Konfiguration dient dazu, die zufällige Zuweisung eines Ports für den rpc.mountd Dienst/Daemon zu unterbinden und immer den Port 892 zu verwenden, da sonst Firewall-Freischaltungen zu einem Problem werden würden.

nfs: Start einrichten

Um die Auslieferung eines gespiegelten Repositorys via NFS-Server zu realisieren, muss dessen Komponente nfs als Dienst/Deamon als Hintergrundprozess laufen. Um diesen Daemon/Dienst auch nach einem Neustart des Servers zur Verfügung zu haben, soll der Dienst/Daemon mit dem Server mit gestartet werden, was mit nachfolgendem Befehl realisiert werden kann:

# chkconfig nfs on

Eine Überprüfung, ob beim Neustart des Server der nfs-Dienst/Deamon wirklich mit gestartet wird, kann mit nachfolgendem Befehl erfolgen und sollte eine Anzeige, wie ebenfalls nachfolgend dargestellt ausgeben:

# chkconfig --list | grep nfs
nfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off
nfslock         0:off   1:off   2:off   3:on    4:on    5:on    6:off

nfs: /etc/exports

Um auf die Verzeichnisse im NFS-Server zugreifen zu können ist nachfolgend dargestellte Konfiguration notwendig.

Nachfolgende Konfiguration an der Konfigurationsdatei

  • /etc/exports

die standardmäßig leer ist und wie nachfolgend dargestellt gefüllt werden muss.

Hier die Anpassungen an der Konfigurationsdatei /etc/exports:

/data/repository/private/Mirrors        192.168.0.0/255.255.255.0(ro,sync,no_root_squash) 192.168.0.1/255.255.255.0(ro,sync,no_root_squash)

nfs: IPv6 ausschalten

In Verbindung mit diesem Thema, kann nachfolgender Link innerhalb dieses DokuWiki's ebenfalls nützlich sein:

Um die Verwendung von IPv6 in Verbindung mit z.B. nfs zu unterbinden, ist nachfolgend dargestellte Konfiguration notwendig.

Nachfolgende Konfiguration an der Konfigurationsdatei

  • /etc/netconfig

muss wie nachfolgend dargestellt angepasst werden:

Hier die Anpassungen an der Konfigurationsdatei /etc/netconfig:

#
# The network configuration file. This file is currently only used in
# conjunction with the TI-RPC code in the libtirpc library.
#
# Entries consist of:
#
#       <network_id> <semantics> <flags> <protofamily> <protoname> \
#               <device> <nametoaddr_libs>
#
# The <device> and <nametoaddr_libs> fields are always empty in this
# implementation.
#
udp        tpi_clts      v     inet     udp     -       -
tcp        tpi_cots_ord  v     inet     tcp     -       -
# Tachtler
# default: udp6       tpi_clts      v     inet6    udp     -       -
#udp6       tpi_clts      v     inet6    udp     -       -
# Tachtler
# default: tcp6       tpi_cots_ord  v     inet6    tcp     -       -
#tcp6       tpi_cots_ord  v     inet6    tcp     -       -
rawip      tpi_raw       -     inet      -      -       -
local      tpi_cots_ord  -     loopback  -      -       -
unix       tpi_cots_ord  -     loopback  -      -       -

nfs: Starten

Um die Auslieferung eines gespiegelten Repositorys via NFS-Server zu realisieren, muss dessen Komponente nfs als Dienst/Deamon als Hintergrundprozess laufen. Um starten des nfs als Dienst/Deamon kann nachfolgenden Befehlen verwendet werden:

# service rpcbind start
Starting rpcbind:                                          [  OK  ]
# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]

Eine einfache Überprüfung, ob der xinetd/tftp Dienst/Daemon auch wirklich gestartet ist, kann unter anderem mit nachfolgendem Befehl durchgeführt werden:

# netstat -tulpen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       User       Inode      PID/Program name   
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      0          22151      4266/rpcbind        
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      0          7773       1022/sshd           
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      0          8027       1118/master         
tcp        0      0 0.0.0.0:892                 0.0.0.0:*                   LISTEN      0          22266      4318/rpc.mountd     
tcp        0      0 0.0.0.0:2049                0.0.0.0:*                   LISTEN      0          22234      -                   
tcp        0      0 0.0.0.0:53767               0.0.0.0:*                   LISTEN      0          22245      -                   
udp        0      0 0.0.0.0:621                 0.0.0.0:*                               0          22150      4266/rpcbind        
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               0          22146      4266/rpcbind        
udp        0      0 10.0.0.40:123               0.0.0.0:*                               0          7818       1030/ntpd           
udp        0      0 127.0.0.1:123               0.0.0.0:*                               0          7817       1030/ntpd           
udp        0      0 0.0.0.0:123                 0.0.0.0:*                               0          7813       1030/ntpd           
udp        0      0 0.0.0.0:2049                0.0.0.0:*                               0          22236      -                   
udp        0      0 0.0.0.0:37531               0.0.0.0:*                               0          22244      -                   
udp        0      0 0.0.0.0:34743               0.0.0.0:*                               0          22261      4318/rpc.mountd     
udp        0      0 0.0.0.0:69                  0.0.0.0:*                               0          19606      3237/xinetd

DHCP-Server Konfiguration

Damit bei der Ausführung eines PXE-Boot auch der xinetd/tftp Dienst/Daemon/Server im Netzwerk gefunden wird, müssen nachfolgend dargestellte Konfigurationszeilen dem im Netzwerk befindlichen DHCP-Server hinzugefügt werden.

Die Installation und Konfiguration eines DHCP-Servers kann wie hier beschrieben erfolgen:

Nachfolgende Zeilen müssen zur Konfigurationsdatei /etc/dhcp/dhcpd.conf hinzugefügt werden (nur relevanter Ausschnitt):

...
# ==============================================================================
# PXE-Boot options.
# ==============================================================================
 
# The booting flag is used to tell dhcpd to respond to a client.
allow booting;
 
# The bootp flag is used to tell dhcpd to respond to bootp queries.
allow bootp;
 
# The next-server statement is to specify the address where the boot file are.
next-server 10.0.0.40;
 
# The filename statement can be used to specify the name of the initial boot.
filename "/pxelinux.0";
 
...

:!: WICHTIG - Abschließend ist ein Neustart des DCHP-Servers erforderlich !!!

Der Neustart des DHCP-Servers kann durch ausführen des nachfolgenden Befehls durchgeführt werden:

# service dhcpd restart
Shutting down dhcpd:                                       [  OK  ]
Starting dhcpd:                                            [  OK  ]

Kickstart Konfigurieren

Um ein wenig mehr Komfort in die Installation zu bringen, kann eine sogenannte „Kickstart“-Konfigurationsdatei erstellt werden, in der Angaben enthalten sind, welche sonst während der Installation eingegeben werden müssen, dies können z.B.:

  • Sprache
  • Tastaturlayout
  • Zeitzone
  • uvm.

sein.

Um eine sogenannte „Kickstart“-Konfigurationsdatei Verfügbar zu machen sind nachfolgende Schritte erforderlich.

Kickstart Datei erstellen

Im nachfolgenden Beispiel wird durch nachfolgenden Befehl ein Verzeichnis mit dem Namen

  • /data/kickstart

erstellt:

# mkdir -p /data/kickstart

Anschließend sollte nachfolgende eine Datei im Verzeichnis /data/kickstart mit den Namen

  • /date/kickstart/ks_centos60_x86_64.cfg bzw.
  • /date/kickstart/ks_centos60_i386.cfg

nachfolgendem Inhalt erstellt werden (Der Inhalt ist ein Beispiel und mit Kommentaren versehen):

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use graphical install
graphical
# Firewall configuration
firewall --enabled --ssh
# Run the Setup Agent on first boot
firstboot --enabled
# Use interactive kickstart installation method
# interactive
# System keyboard
keyboard de-latin1-nodeadkeys
# System language
lang en_US
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.0.40 --dir=/data/repository/pub/Mirrors/centos/6.0/os/x86_64
# Embed updates 
repo --name=updates --baseurl=http://install.dmz.tachtler.net/centos/6.0/updates/x86_64/
#Root password
rootpw --iscrypted $1$tzGd4pwf$ybo9G3xFsfbwp09dG2AKBv/
 
# SELinux configuration
selinux --disabled
# Services enabled or disabled
services --disabled ip6tables
# System timezone
timezone --isUtc Europe/Berlin
# Install OS instead of upgrade
install

Boot-Menü ergänzen

Um dem über PXE-Boot anfragendem System ein minimales Betriebssystem mit einem Auswahlmenü über das Netzwerk zu transferieren, muss ebenfalls eine Menü-Datei erstellt werden.

Um dies zu realisieren, ist vorab erst einmal eine Datei in nachfolgendem Verzeichnis mit nachfolgendem Namen zu erstellen

  • /var/lib/tftpboot/pxelinux.cfg/default

Der Inhalt dieser Konfigurationsdatei des anzuzeigenden Menüs inklusive Kickstart-Konfigurationsdatei, könnte wie nachfolgend dargestellt aussehen:

PROMPT 1
TIMEOUT 600
DISPLAY pxelinux.cfg/menumain.msg
F1 pxelinux.cfg/menumain.msg
 
DEFAULT localdisk
 
LABEL localdisk
        MENU LABEL Boot from local hard drive
        LOCALBOOT 0
 
LABEL centos60_i386
        MENU LABEL Install CentOS 6.0 32-bit
        KERNEL images/centos/6.0/i386/vmlinuz
        APPEND initrd=images/centos/6.0/i386/initrd.img ramdisk_size=128000 ks=nfs:192.168.0.40:/data/kickstart/ks_centos60_i386.cfg
 
LABEL centos60_x86_64
        MENU LABEL Install CentOS 6.0 64-bit
        KERNEL images/centos/6.0/x86_64/vmlinuz
        APPEND initrd=images/centos/6.0/x86_64/initrd.img ramdisk_size=128000 ks=nfs:192.168.0.40:/data/kickstart/ks_centos60_x86_64.cfg

nfs: /etc/exports ergänzen

Um auf die Verzeichnisse im NFS-Server zugreifen zu können ist nachfolgend dargestellte Konfiguration notwendig.

Nachfolgende Konfiguration an der Konfigurationsdatei

  • /etc/exports

die standardmäßig leer ist und wie nachfolgend dargestellt gefüllt werden muss.

Hier die Anpassungen an der Konfigurationsdatei /etc/exports - inklusive Kickstart-Konfigurationsverzeichnis:

/data/repository/private/Mirrors        192.168.0.0/255.255.255.0(ro,sync,no_root_squash) 192.168.0.1/255.255.255.0(ro,sync,no_root_squash)
/data/kickstart                         192.168.0.0/255.255.255.0(ro,sync,no_root_squash) 192.168.0.1/255.255.255.0(ro,sync,no_root_squash)

Neustarts durchführen

Um die vorangegangenen Änderungen wirksam werden zu lassen sind die betroffenen Dienste/Daemons

  • xinted/tftp
  • nfs

neu zu starten, was mit nachfolgenden Befehlen durchgeführt werden kann:

# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
# service rpcbind restart
Stopping rpcbind:                                          [  OK  ]
Starting rpcbind:                                          [  OK  ]
# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]

:!: WICHTIG - Bei Problemen, sollte der DHCP-Server im Auge behalten werden und auf die Vergabe von möglichen lease-Dateien sollte achten !!!

Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
tachtler/repository_ausliefern_centos_6.txt · Zuletzt geändert: 2012/09/12 22:45 von klaus