pxe + kickstart v3

# ipcalc -nmpb 172.16.44.0/28

NETMASK=255.255.255.240
PREFIX=28
BROADCAST=172.16.44.15
NETWORK=172.16.44.0


# vi /etc/sysconfig/dhcpd

# Command line options here
DHCPDARGS="em1"


# vi /etc/dhcp/dhcpd.conf

shared-network dinglcom {
     subnet 172.16.44.0 netmask 255.255.255.240 {
     range dynamic-bootp 172.16.44.50 172.16.44.100;
     allow booting;
     allow bootp;
     next-server 172.16.44.20;

     # 本地地址

     filename "pxelinux.0"; 
     max-lease-time 3600;
     default-lease-time 2600;
    }

  subnet 172.16.40.0 netmask 255.255.255.0 {
     range 172.16.40.180;

     # 这个地址空间为了包含提供服务的

    }
  }


# chkconfig tftp on

# vi /etc/xinetd.d/tftp

service tftp
{
    socket_type        = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server            = /usr/sbin/in.tftpd
    server_args        = -s /var/lib/tftpboot
    disable            = no
    per_source        = 11
    cps            = 100 2
    flags            = IPv4
}

# netstat -nlup | grep xinetd | grep 69

udp        0      0 0.0.0.0:69                  0.0.0.0:*                               7107/xinetd


# vi /etc/httpd/conf/httpd.conf

Listen 172.16.44.1:80

User apache

Group apache

Alias /pxe "/home/pxe/linux/rhel6.3"
<Directory "/home/pxe/linux/rhel6.3/">
   Options Indexes MultiViews
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

# cp ks.cfg /home/pxe/linux/rhel6.3/

# /etc/init.d/httpd start

# chown -R apache /home/pxe/linux

# wget http://172.16.44.20/pxe/ks.cfg

测试客户端有没有可能获得 ks.cfg 文档

# lynx 172.16.44.1/pxe


# vi /var/lib/tftpboot/pxelinux.cfg/default

default rhel

timeout 30

prompt 1

display msgs/boot.msg

F1 msgs/boot.msg

F2 msgs/other.msg

label local

    localboot 1

label centos

    kernel centos/vmlinuz

    append initrd=centos/initrd.img

label ubuntu

    kernel centos/vmlinuz

    append initrd=ubuntu/initrd.img

label rhel

    kernel centos/vmlinuz

    append initrd=rhel/initrd.img

    append ks=http://localhost/pxe/ks.cfg

# in http config file

# Alias /pxe "/home/pxe/linux/rhel6.3


# system-config-kickstart

.....


# vi boot.msg

default install rhel

centos: will install centos

ubuntu: will install ubuntu

rhel: will install rhel



wKiom1XibfqitA3rAABngpxKQnk822.jpg

你可能感兴趣的:(TFTP,pxe,dhcpd)