多语言展示
当前在线:696今日阅读:19今日分享:20

pxe自动化安装系统

实验环境 “rhel 5ip 192.168.0.106#把防火墙关掉service iptables stopsetenforce 0
工具/原料
1

vsftp+tftp+dhcp+pxe+kickstart

2

linux红帽系统

方法/步骤
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-onlyyum -y install system-config-kickstartsystem-config-kickstartcp ./ks.cfg /var/ftp service dhcpd restartservice xinetd restartservice vsftp restart

注意事项

注意地址 服务不要写错了

推荐信息