Chinaunix首页 | 论坛 | 博客
  • 博客访问: 491180
  • 博文数量: 484
  • 博客积分: 10145
  • 博客等级: 上将
  • 技术积分: 5805
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-27 18:34
文章分类

全部博文(484)

文章存档

2011年(52)

2010年(107)

2009年(287)

2008年(38)

我的朋友

分类: LINUX

2009-08-21 09:28:16

linux下DHCP+PXE配置
2007-07-09 17:37
#一个简单的默认dhcp服务器配置文件/etc/dhcpd.conf
ddns-update-style interim;

subnet 172.16.0.0 netmask 255.255.255.0 {
        range 172.16.0.10 172.16.0.253;
        option routers 172.16.0.1;
        option subnet-mask 255.255.255.0;
}

#配置dhcp服务器
###################################
#放在/etc/dhcpd.conf末尾就可以了
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
class "pxeclients" {
    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
    option vendor-class-identifier "PXEClient";
    vendor-option-space PXE;
    # At least one of the vendor-specific PXE options must be set in
    # order for the client boot ROMs to realize that we are a PXE-compliant
    # server. We set the MCAST IP address to 0.0.0.0 to tell the boot ROM
    # that we can't provide multicast TFTP (address 0.0.0.0 means no
    # address).
    option PXE.mtftp-ip 0.0.0.0;
    # This is the name of the file the boot ROMs should download.
    filename "pxelinux.0";
    # This is the name of the server they should get it from.
    next-server 192.168.1.246; //tftp服务器,可以和dhcp服务器不在同一个机器上
}
###################################


#打开tftp
chkconfig tftp --level 345 on
vi /etc/xinetd.d/tftp #看看内容,不用改

cd /tftpboot/
mkdir pxelinux.cfg
vi default
#######################
#default的内容如下
DEFAULT install
        PROMPT 1
        LABEL install FC5-x86
        KERNEL vmlinuz
        APPEND initrd=initrd.img devfs=nomount ramdisk_size=16384
#######################

拷贝光盘的/images/pxeboot/或者FC5/isolinux下面的initrd.img和vmlinuz到/tftpboot下,注意,必须用光盘上的,不能用硬盘的.
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/

#启动tftp服务
/etc/init.d/xinetd restart
阅读(696) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~