# mv /etc/dnsmasq.conf /etc/dnsmasq.conf.backup # vim /etc/dnsmasq.conf
interface=eth0,lo #bind-interfaces domain=centos6.lan # DHCP range-leases dhcp-range= eth0,192.168.0.3,192.168.0.253,255.255.255.0,1h # PXE dhcp-boot=pxelinux.0,pxeserver,192.168.0.132 # Gateway dhcp-option=3,192.168.0.1 # DNS dhcp-option=6,192.168.0.1, 8.8.8.8 server=8.8.4.4 # Broadcast Address dhcp-option=28,192.168.0.255 # NTP Server dhcp-option=42,0.0.0.0 pxe-prompt="Press F8 for menu.", 60 pxe-service=x86PC, "Install CentOS 6 from network server 192.168.0.132", pxelinux enable-tftp tftp-root=/var/lib/tftpboot
interface – Interfaces that the server should listen and provide services.
bind-interfaces – Uncomment to bind only on this interface.
domain – Replace it with your domain name.
dhcp-range – Replace it with IP range defined by your network mask on this segment.
dhcp-boot – Replace the IP statement with your interface IP Address.
dhcp-option=3,192.168.0.1 – Replace the IP Address with your network segment Gateway.
dhcp-option=6,92.168.0.1 – Replace the IP Address with your DNS Server IP – several DNS IPs can be defined.
server=8.8.4.4 – Put your DNS forwarders IPs Addresses.
dhcp-option=28,192.168.0.255 – Replace the IP Address with network broadcast address –optionally.
dhcp-option=42,0.0.0.0 – Put your network time servers – optionally (0.0.0.0 Address is for self-reference).
pxe-prompt – Leave it as default – means to hit F8 key for entering menu 60 with seconds wait time..
pxe=service – Use x86PC for 32-bit/64-bit architectures and enter a menu description prompt under string quotes. Other values types can be: PC98, IA64EFI, Alpha, Arcx86, IntelLeanClient, IA32EFI, BCEFI, XscaleEFI and X86-64EFI.
enable-tftp – Enables the build-in TFTP server.
tftp-root – Use /var/lib/tftpboot – the location for all netbooting files.
read more dnsmasq manual
STEP 2: INSTALL SYSLINUX BOOTLOADERS
1 2
# yum install syslinux # ls /usr/share/syslinux
STEP 3: INSTALL TFTP-SERVER AND POPULATE IT WITH SYSLINUX BOOTLOADERS
Typically the PXE Server reads its configuration from a group of specific files (GUID files – first, MAC files – next, Default file – last) hosted in a folder called pxelinux.cfg, which must be located in the directory specified in tftp-root statement from DNSMASQ main configuration file.
# vim /var/ftp/ks.cfg #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use network installation url --url="ftp://192.168.0.132/pub" # Root password rootpw --iscrypted $1$MzJZISZ7$wX0pW3sFy/5y80l2BAQD81 # System authorization information auth --useshadow --passalgo=sha512 # Use graphical install #graphical text
%include /tmp/network.ks
firstboot --disable # System keyboard keyboard us # System language lang en_US # SELinux configuration selinux --disabled # Installation logging level logging --level=info # Reboot after installation #reboot # System timezone timezone Australia/Sydney # Network information network --bootproto=dhcp --device=eth0 --onboot=on # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --asprimary --fstype="ext4" --size=250 part swap --asprimary --fstype="swap" --size=1024 part / --asprimary --fstype="ext4" --grow --size=1
#vim /var/ftp/pub/install_mysql groupadd mysql useradd -s /sbin/nologin -g mysql -M mysql tail -1 /etc/passwd id mysql # setup the tar file download add wget ftp://192.168.0.134/pub/mysql-5.5.50-linux2.6-x86_64.tar.gz tar xf mysql-5.5.50-linux2.6-x86_64.tar.gz mkdir -p /application/ mv mysql-5.5.50-linux2.6-x86_64 /application/mysql-5.5.50 ln -s /application/mysql-5.5.50/ /application/mysql ls -l /application/ cd /application/mysql/ ls -l support-files/*.cnf /bin/cp support-files/my-medium.cnf /etc/my.cnf mkdir -p /application/mysql/data chown -R mysql.mysql /application/mysql/ /application/mysql/scripts/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data/ --user=mysql /bin/cp support-files/mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init.d/mysqld
/etc/init.d/mysqld start netstat -lntup|grep mysql
chkconfig --add mysqld chkconfig mysqld on chkconfig --list mysqld
echo 'export PATH=/application/mysql/bin:$PATH' >> /etc/profile tail -1 /etc/profile source /etc/profile echo $PATH # after install run the following command #/application/mysql/bin/mysql_secure_installation