Installation eines Centos 7 Servers mit TFPT, VSFTPD und DNSMASQ
1 |
yum -y install dnsmasq |
Konfiguration entsprechend der Umgebung anpassen.
/etc/dnsmasq.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
interface=eth1 bind-interfaces domain=tuxclouds.org # DHCP range-leases dhcp-range= eth1,192.168.1.1,192.168.1.253,255.255.255.0,1h # PXE dhcp-boot=pxelinux.0,pxeserver,192.168.1.254 # Gateway dhcp-option=3,192.168.1.254 # DNS dhcp-option=6,192.168.1.254, 8.8.8.8 server=8.8.4.4 # Broadcast Address dhcp-option=28,192.168.1.255 # NTP Server dhcp-option=42,0.0.0.0 pxe-prompt="Press F8 for menu.", 60 pxe-service=x86PC, "Installation von CentOS 7 von einem Netzwerk Server 192.168.1.254", pxelinux enable-tftp tftp-root=/var/lib/tftpboot |
Bootloader installieren
1 |
yum -y install syslinux |
TFTP-Server installieren und die Bootloader Dateien kopieren
1 2 |
yum -y install tftp-server cp -r /usr/share/syslinux/* /var/lib/tftpboot |
PXE Server Konfiguration pxelinux.cfg
/var/lib/tftpboot/pxelinux.cfg/default
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
default menu.c32 prompt 0 timeout 300 ONTIMEOUT local menu title ########## PXE Boot Menu ########## label 1 menu label ^1) Installation von CentOS 7 x64 vom internen FTP Repo kernel centos7/vmlinuz append initrd=centos7/initrd.img method=ftp://192.168.1.254/pub devfs=nomount label 2 menu label ^2) Installation von CentOS 7 x64 von http://mirror.centos.org Repo kernel centos7/vmlinuz append initrd=centos7/initrd.img method=http://mirror.centos.org/centos/7/os/x86_64/ devfs=nomount ip=dhcp label 3 menu label ^3) Installation von CentOS 7 x64 vom internen FTP Repo mit VNC kernel centos7/vmlinuz append initrd=centos7/initrd.img method=ftp://192.168.1.254/pub devfs=nomount inst.vnc inst.vncpassword=password label 4 menu label ^4) Von lokaler Festplatte starten label 5 menu label ^5) Installation von CentOS 7 x64 vom internen FTP Repo mit Kickstart kernel centos7/vmlinuz append initrd=centos7/initrd.img inst.repo=ftp://192.168.1.254/pub ks=ftp://192.168.1.254/pub/anaconda-ks.cfg |
ISO Image herunterladen und mounten
1 2 |
wget http://ftp.fau.de/centos/7.4.1708/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso mount -o loop /verzeichnis/zum/centos-dvd.iso /mnt |
PXE Verzeichnis erstellen für die Boot Dateien und diese kopieren
1 2 3 |
mkdir /var/lib/tftpboot/centos7 cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7 cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot/centos7 |
FTP Repo aufbauen
1 2 3 |
yum -y install vsftpd cp -r /mnt/* /var/ftp/pub/ chmod -R 755 /var/ftp/pub |
Alle benötigten Dienste starten und aktivieren
1 2 3 4 5 6 |
systemctl start dnsmasq systemctl status dnsmasq systemctl start vsftpd systemctl status vsftpd systemctl enable dnsmasq systemctl enable vsftpd |
Kickstart Konfigurationsdatei erstellen, überprüfen und verfügbar machen
1 |
vi /var/ftp/pub/anaconda-ks.cfg |
/root/anaconda-ks.cfg (als Default nehmen oder von Redhat kopieren)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
#version=RHEL7 # System authorization information auth --enableshadow --passalgo=sha512 # Use network installation url --url="ftp://192.168.1.254/pub/" # Run the Setup Agent on first boot firstboot --enable ignoredisk --only-use=sda # Keyboard layouts keyboard --vckeymap=de --xlayouts='de' # System language lang de_DE.UTF-8 # Network information network --bootproto=dhcp --device=eth0 --ipv6=auto --activate network --hostname=client1.tuxclouds.org # Root password rootpw --iscrypted $6$RMPTNRo5P7zulbAR$ueRnuz70DX2Z8Pb2oCgfXv4qXOjkdZlaMnC.CoLheFrUF4BEjRIX8rF.2QpPmj2F0a7iOBM3tUL3tyZNKsDp50 # System services services --enabled="chronyd" # System timezone timezone Europe/Berlin --isUtc # System bootloader configuration bootloader --location=mbr --boot-drive=sda # Partition clearing information clearpart --none --initlabel # Disk partitioning information part pv.20 --fstype="lvmpv" --ondisk=sda --size=19979 part /boot --fstype="xfs" --ondisk=sda --size=500 volgroup centos --pesize=4096 pv.20 logvol / --fstype="xfs" --grow --maxsize=51200 --size=1024 --name=root --vgname=centos logvol swap --fstype="swap" --size=2048 --name=swap01 --vgname=centos %packages @compat-libraries @core wget net-tools chrony %end |
Verifizieren auf Syntax-Fehler
1 2 |
yum -y install pykickstart ksvalidator /var/ftp/pub/anaconda-ks.cfg |
Comments