Deploy Dnsmasq in Ubuntu to enable automatic Kickstart installation of the Operating System

Source: Internet
Author: User
References 1. Workshop

References
1. http://www.linuxidc.com/Linux/2012-07/65748.htm

Update apt-get source and install required software
Sudo apt-get install syslinux dnsmasq apache2

Configure dnsmasq
Sudo vim/etc/dnsmasq. conf
Remove the # Above the following items
Bogus-priv
Filterwin2k
Interface = eth0
Dhcp-range = 192.168.44.100, 192.168.44.120, 12 h
Dhcp-boot = pxelinux.0
Enable-tftp
Tftp-root =/var/ftpd
Dhcp-authoritative

The eth0 following the interface indicates listening to this network card. If you want all network cards connected to the network to be served, comment out this line.

Copy the files required to install CentOS6
Sudo mkdir-p/var/www/centos6/mnt/cd/var/ftpd/pxelinux. cfg
Sudo mount-o loop-t auto ~ /Iso/CentOS-6.2-x86_64-bin-DVD1.iso/mnt/cd
Sudo cp-rv/mnt/cd/*/var/www/centos6
Sudo cp-rv/mnt/cd/isolinux/*/var/ftpd
Sudo cp/usr/lib/syslinux/pxelinux.0/var/ftpd
Sudo mv/var/ftpd/isolinux. cfg/var/ftpd/pxelinux. cfg/default
To deploy ttuserver12, you also need to mount the image and copy all the files to the http directory, such as/var/www/Ubuntuserver12. However, the following steps are not required, the following isolinux is started by creating pxe, and one copy is enough.

Ubuntu server installation may prompt http: // 192.168.44.249/effectuserver12/dists/precise/restricted/binary-amd64/Packages was too upt. This is a bug
The solution is to directly touch an empty file.
Sudo touch/var/www/ubuntu/dists/precise/restricted/binary-amd64/Packages
Precise is the version code of ubuntu12.04.4. If it is another version, replace it with the corresponding code.

Create centos6 ks. cfg
Sudo vim/var/www/centos6/ks. cfg
# Centos6/ks. cfg
Firewall -- disabled
Install
Url -- url http: // 192.168.44.249/centos6
Text
Firstboot -- disable
Rootpw admaster
Auth -- useshadow -- enablemd5
Lang en_US
Keyboard us
Selinux -- disabled
Logging -- level = info
Reboot
Timezone -- isUtc Asia/Shanghai
Network -- bootproto = dhcp -- device = eth0 -- onboot = on
Zerombr
Bootloader -- location = mbr
Clearpart -- all -- initlabel
Part swap -- fstype = "swap" -- size = 4096
Part/boot -- fstype = "ext4" -- size = 200
Part/-- fstype = "ext4" -- size = 1 -- grow
% Packages
Openssh-server
Openssh
Vim

Create ubuntu ks. cfg
Sudo vim/var/www/javastuserver12/ks. cfg
# Ttuser kickstart file
Install
Url -- url http: // 192.168.44.249/ubuntuserver12

Preseed passwd/root-login boolean true
Lang en_US
Langsupport -- default en_US.UTF-8 en_US.UTF-8

Keyboard us
Mouse
Timezone Asia/Shanghai

Rootpw -- disabled
User john -- fullname "john chu" -- password admaster
Reboot
Text

Bootloader -- location = mbr
Zerombr yes
Clearpart -- all -- initlabel
Partman-lvm/device_remove_lvm boolean true

Partman-md/device_remove_md boolean true

Part/-- fstype ext4 -- size 1 -- grow -- asprimary

# When swap is not set, the system will prompt whether to re-Add the swap partition during the installation process.
Part swap -- size 4096

Auth -- useshadow -- enablemd5
Network -- bootproto = dhcp -- device = eth0
Firewall -- disabled
Skipx

% Packages
@ Base
Openssh-server
Openssh-client
Vim
Gcc
Make


Modify the pxe Startup Menu
Sudo vim/var/ftpd/pxelinux. cfg/default
Append ks = http: // 192.168.44.249/centos6/ks. cfg initrd = initrd. img


If you have other systems, you can add them by yourself. You can locate the kernel and initrd accurately.

Restart dnsmasq
Sudo service dnsmasq restart

If ubuntu is installed, there are two differences: 1 is the ks file is slightly different; 2 is the default file of the boot menu after pxe is started, must use the centos style, otherwise, the kernel and initialization environment cannot be found. Ubuntu's default file must be integrated with the txt. cfg file, and the ui and include lines should be commented out (personal opinion)

DNSmasq: Click here
DNSmasq: Click here

Reading:

Under Ubuntu 10.10, DNSmasq and Named seem to have a conflicting http://www.linuxidc.com/Linux/2010-12/30338.htm

Http://www.linuxidc.com/Linux/2008-12/17589.htm for DNS and DHCP services using DNSmasq in Ubuntu 8.10

Build a small Intranet DNS http://www.linuxidc.com/Linux/2013-04/82073.htm with DNSmasq

Http://www.linuxidc.com/Linux/2013-11/92573.htm of Cobbler + DNSmasq + tftpd-hpa installation configuration under Ubuntu Server 12.04

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.