. Use Yum utility to Install required rpm
#yum install dhcp tftp-server syslinux httpd nfs-utils system-config-kickstart bind-*
2. Configure Dns server for host name resolution
#cp -p /etc/named.* /var/named/chroot/etc
#cp -p /var/named.* /var/named/chroot/var/named
#rm -rf /etc/named.*
#rm -rf /var/named.*
#cd /var/named/chroot/etc
#vim named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.0.254; }; <= Define here the ip of dns
listen-on-v6 port 53 { ::1; };
directory
"/var/named";
dump-file
"/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone “example.com” IN { <= Here declare the forward zone
type master;
file “for.zone”;
};
zone “0.168.192.in-addr.arpa” IN { <= Here declare reverse zone
type master;
file “rev.zone”;
}
:wq
#cd /var/named/chroot/var/named
#cp -p named.localhost f.zone
#cp -p named.loopback r.zone
#vim f.zone
$TTL 1D
@
IN SOA server1.example.com. root.server1.example.com. (
0; serial
1D; refresh
1H ; retry
1W; expire
3H ) ; minimum
NS server1.example.com.
server1 A 192.168.0.254
desktop1 A 192.168.0.1
desktop2 A 192.168.0.2
desktop3
:wq
#vim r.zone
$TTL @ IN SOA server1.example.com. server1.example.com. (
0; serial
1D; refresh
1H ; retry
1W; expire
3H ) ; minimum
NS server1.example.com.
254 PTR server1.example.com.
1 PTR desktop1.example.com.
2 PTR desktop2.example.com.
3 PTR desktop3.example.com.
:wq
#chkconfig named on ; /etc/init.d/named restart
2. Now Configure the dhcp server
#vim /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
allow booting;
allow bootp;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.1 192.168.0.11;
next-server 192.168.0.254; <= tftp Server ip
filename "pxelinux.0";
}
:wq
#chkconfig dhcpd on;/etc/init.d/dhcpd restart
3. Configure tftp server
#vim /etc/xinetd.d/tftp
disabled = no
:x
Mount RHEL6 OS dvd on /media directory & copy files required for tftp server
#mount /dev/scd0 /media
#cp -rv /media/isolinux/* /var/lib/tftpboot
#cp -rv /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
#mkdir /var/lib/tftpboot/pxelinx.cfg
#cp /var/lib/tftpboot/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
Make the OS dump
#cp -rv /media/* /var/www/html
#vim /var/lib/tftpboot/pxelinux.cfg/default
<= Make this entery at bottom
label RHEL6-32.bit
menu label ^Install RHEL6-32.bit Unattended
menu defult
kernel vmlinuz
append initrd=initrd.img linux ks=http://192.168.0.254/ks.cfg
:wq
4. Create a ks file by the name of ks.cg, to make pxe unattended by using system-config-kickstart & save it in /var/www/html
5. Start the service xinetd, httpd & on the tftp server
#chkconfig xinetd on ; /etc/init.d/xinetd restart
#chkconfig tftp on
#chkconfig httpd on ; /etc/init.d/httpd restart
Now pxe is ready to Install single OS.
#yum install dhcp tftp-server syslinux httpd nfs-utils system-config-kickstart bind-*
2. Configure Dns server for host name resolution
#cp -p /etc/named.* /var/named/chroot/etc
#cp -p /var/named.* /var/named/chroot/var/named
#rm -rf /etc/named.*
#rm -rf /var/named.*
#cd /var/named/chroot/etc
#vim named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.0.254; }; <= Define here the ip of dns
listen-on-v6 port 53 { ::1; };
directory
"/var/named";
dump-file
"/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone “example.com” IN { <= Here declare the forward zone
type master;
file “for.zone”;
};
zone “0.168.192.in-addr.arpa” IN { <= Here declare reverse zone
type master;
file “rev.zone”;
}
:wq
#cd /var/named/chroot/var/named
#cp -p named.localhost f.zone
#cp -p named.loopback r.zone
#vim f.zone
$TTL 1D
@
IN SOA server1.example.com. root.server1.example.com. (
0; serial
1D; refresh
1H ; retry
1W; expire
3H ) ; minimum
NS server1.example.com.
server1 A 192.168.0.254
desktop1 A 192.168.0.1
desktop2 A 192.168.0.2
desktop3
:wq
#vim r.zone
$TTL @ IN SOA server1.example.com. server1.example.com. (
0; serial
1D; refresh
1H ; retry
1W; expire
3H ) ; minimum
NS server1.example.com.
254 PTR server1.example.com.
1 PTR desktop1.example.com.
2 PTR desktop2.example.com.
3 PTR desktop3.example.com.
:wq
#chkconfig named on ; /etc/init.d/named restart
2. Now Configure the dhcp server
#vim /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
allow booting;
allow bootp;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.1 192.168.0.11;
next-server 192.168.0.254; <= tftp Server ip
filename "pxelinux.0";
}
:wq
#chkconfig dhcpd on;/etc/init.d/dhcpd restart
3. Configure tftp server
#vim /etc/xinetd.d/tftp
disabled = no
:x
Mount RHEL6 OS dvd on /media directory & copy files required for tftp server
#mount /dev/scd0 /media
#cp -rv /media/isolinux/* /var/lib/tftpboot
#cp -rv /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
#mkdir /var/lib/tftpboot/pxelinx.cfg
#cp /var/lib/tftpboot/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
Make the OS dump
#cp -rv /media/* /var/www/html
#vim /var/lib/tftpboot/pxelinux.cfg/default
<= Make this entery at bottom
label RHEL6-32.bit
menu label ^Install RHEL6-32.bit Unattended
menu defult
kernel vmlinuz
append initrd=initrd.img linux ks=http://192.168.0.254/ks.cfg
:wq
4. Create a ks file by the name of ks.cg, to make pxe unattended by using system-config-kickstart & save it in /var/www/html
5. Start the service xinetd, httpd & on the tftp server
#chkconfig xinetd on ; /etc/init.d/xinetd restart
#chkconfig tftp on
#chkconfig httpd on ; /etc/init.d/httpd restart
Now pxe is ready to Install single OS.
No comments:
Post a Comment