pxe自动化安装系统

2025-11-16 05:14:40

1、#挂载镜像到/mnt下

[root@localhost ~]# mount /dev/cdrom /mnt

[root@localhost ~]# vim /etc/yum.repos.d/yum.repo [aaa]name=anbaseurl=file:///mnt/Servergpgcheck=0

2、oot@localhost ~]# vim /etc/dhcpd.confddns-update-style interim;ignore client-updates;

subnet 192.168.0.0 netmask 255.255.255.0 {

        option routers                  192.168.0.106;        option subnet-mask              255.255.255.0;        next-server                     192.168.0.106;        filename                        "pxelinux.0";        option nis-domain               "domain.org";        option domain-name              "domain.org";        option domain-name-servers      192.168.0.106;

        option time-offset              -18000; # Eastern Standard Time

        range dynamic-bootp 192.168.0.128 192.168.0.254;        default-lease-time 21600;        max-lease-time 43200;

}   

3、  [root@localhost /]# ls backup  dev   lib         misc  opt   sbin     srv       tmpbin     etc   lost+found  mnt   proc  selinux  sys       usrboot    home  media       net   root  share    tftpboot  var

如果没有 yum -y install tftp-server

#安装下  ftp[root@localhost /]# yum -y install vsftpd  [root@localhost ~]# cd /mnt/images/pxeboot/[root@localhost pxeboot]# lsinitrd.img  README  TRANS.TBL  vmlinuz   [root@localhost pxeboot]# cp vmlinuz initrd.img /tftpboot/  [root@localhost syslinux]# cp pxelinux.0 /tftpboot/[root@localhost syslinux]# pwd/usr/lib/syslinux

[root@localhost tftpboot]# mkdir pxelinux.cfg[root@localhost tftpboot]# cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

[root@localhost tftpboot]# vim pxelinux.cfg/default default linuxprompt 1timeout 600display boot.msgF1 boot.msgF2 options.msgF3 general.msgF4 param.msgF5 rescue.msglabel linux  kernel vmlinuz  append initrd=initrd.img  ks=ftp://192.168.0.106/ks.cfg  #添加软件包地址label text  kernel vmlinuz  append initrd=initrd.img textlabel ks  kernel vmlinuz  append ks initrd=initrd.imglabel local  localboot 1label memtest86  kernel memtest  append -

[root@localhost ~]# vim /etc/xinetd.d/tftp

 # default: off# description: The tftp server serves files using the trivial file transfer \#       protocol.  The tftp protocol is often used to boot diskless \#       workstations, download configuration files to network-aware printers, \#       and to start the installation process for some operating systems.service tftp{        socket_type             = dgram        protocol                = udp        wait                    = yes        user                    = root        server                  = /usr/sbin/in.tftpd        server_args             = -s /tftpboot        disable                 = yes    # 把yes  改成 no        per_source              = 11        cps                     = 100 2        flags                   = IPv4}

#service xinetd restart[root@localhost ~]# service xinetd restartStopping xinetd:                                           [  OK  ]Starting xinetd:                                           [  OK  ][root@localhost ~]#

root@localhost ~]# umount /dev/cdrom /mnt[root@localhost ~]# vim /etc/yum.repos.d/yum.repo[base]name=anbaseurl=ftp://192.168.0.106/pubgpgcheck=0~            [root@localhost ~]# mount /dev/cdrom /var/ftp/pubmount: block device /dev/cdrom is write-protected, mounting read-only

yum -y install system-config-kickstart

system-config-kickstart

cp ./ks.cfg /var/ftp

service dhcpd restartservice xinetd restartservice vsftp restart

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢