Chinaunix首页 | 论坛 | 博客
  • 博客访问: 330568
  • 博文数量: 53
  • 博客积分: 1132
  • 博客等级: 少尉
  • 技术积分: 451
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-18 14:22
文章分类

全部博文(53)

文章存档

2014年(1)

2013年(11)

2012年(17)

2011年(16)

2010年(8)

分类: LINUX

2011-08-26 14:55:25

服务器端使用了 centos 6.0 最小化安装,关闭selinux

  1. yum install -y nginx dhcp xinetd
将系统ISO镜像文件挂载到/data/iso,并将Nginx 页面目录设置为相应文件夹

配置 tftp
  1. cat /etc/xinetd.d/tftp
  2. # default: off
  3. # description: The tftp server serves files using the trivial file transfer \
  4. # protocol. The tftp protocol is often used to boot diskless \
  5. # workstations, download configuration files to network-aware printers, \
  6. # and to start the installation process for some operating systems.
  7. service tftp
  8. {
  9.         socket_type = dgram
  10.         protocol = udp
  11.         wait = yes
  12.         user = root
  13.         server = /usr/sbin/in.tftpd
  14.         server_args = -u nobody -s /data/tftpboot    ( tftp跟路径,-u 所有用户可用,-s 是和dhcp套起来使用的)
  15.         disable = no
  16.         per_source = 11
  17.         cps = 100 2
  18.         flags = IPv4
  19. }
配置 dhcp
  1. cat /etc/dhcp/dhcpd.conf
  2. ddns-update-style interim;
  3. ignore client-updates;
  4. allow booting;
  5. allow bootp;

  6. subnet 10.0.1.0 netmask 255.255.255.0 {

  7. # --- default gateway
  8.         option routers 10.0.1.1;
  9.         option subnet-mask 255.255.255.0;

  10. # option nis-domain "domain.org";
  11.         option domain-name "install.org";
  12.         option domain-name-servers 202.101.172.35;
  13.         option domain-name-servers 202.101.172.48;

  14.         option time-offset -18000; # Eastern Standard Time
  15. # option ntp-servers 192.168.1.1;
  16. # option netbios-name-servers 192.168.1.1;
  17. # --- Selects point-to-point node (default is hybrid). Don't change this unless
    # -- you understand Netbios very well
    #       option netbios-node-type 2;

            range dynamic-bootp 10.0.1.100 10.0.1.250;
            default-lease-time 21600;
            max-lease-time 43200;
            next-server     10.0.1.1;        (tftp服务器IP)
            filename        "/pxelinux.0";        (在客户端获取IP后,执行的文件,在tftp跟路径处使用 -s ,这里就可用使用相对路径,不然只能写绝对路径)

            # we want the nameserver to appear at a fixed address
    #       host ns {
    #               next-server marvin.redhat.com;
    #               hardware ethernet 12:34:56:78:AB:CD;
    #               fixed-address 207.175.42.254;
    #       }

    }
建立 PXE 目录,拷贝系统启动时加载的文件
  1. mkdir -p /data/tftpboot/{images,pxelinux.cfg}
  2. cp /data/iso/isolinux/{boot.msg,splash.jpg,vesamenu.c32} /data/tftpboot/images
  3. cp /data/iso/isolinux/{vmlinuz,initrd.img} /data/tftpboot/images/centso-5.5_x86_64 (对应default 文件中的 kernel 和 append initrd目录)
下面是一个示例,默认安装 CentOS 5.5 x86_64,可按各自需求修改
  1. cat /data/tftpboot/pxelinux.cfg/default
  2. default images/vesamenu.c32
  3. #prompt 1
  4. timeout 600

  5. display images/boot.msg
  6. #display pxelinux.cfg/list

  7. menu background images/splash.jpg
  8. menu title Welcome to Linux installation interface !

  9. menu color border 0 #ffffffff #00000000
  10. menu color sel 7 #ffffffff #ff000000
  11. menu color title 0 #ffffffff #00000000
  12. menu color tabmsg 0 #ffffffff #00000000
  13. menu color unsel 0 #ffffffff #00000000
  14. menu color hotsel 0 #ff000000 #ffffffff
  15. menu color hotkey 7 #ffffffff #ff000000
  16. menu color scrollbar 0 #ffffffff #00000000

  17. label 1
  18.   menu label ^Install CentOS 5.5 x86_64
  19.   menu default
  20.   kernel images/centos-5.5-x86_64/vmlinuz
  21.   append initrd=images/centos-5.5-x86_64/initrd.img
  22. label 2
  23.   menu label ^Install CentOS 5.6 x86_64
  24.   kernel images/centos-5.6-x86_64/vmlinuz
  25.   append initrd=images/centos-5.6-x86_64/initrd.img
  26. label 3
  27.   menu label ^Install CentOS 6.0 x86_64
  28.   kernel images/centos-6.0-x86_64/vmlinuz
  29.   append initrd=images/centos-6.0-x86_64/initrd.img
  30. label rescue    (修复模式启动)
  31.   menu label ^Rescue installed system
  32.   kernel images/centos-6.0-x86_64/vmlinuz
  33.   append initrd=images/centos-6.0-x86_64/initrd.img rescue
  34. label memtest86        (内存测试)
  35.   menu label ^Memory test
  36.   kernel images/memtest
  37.   append -

阅读(856) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~