免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 654 | 回复: 0
打印 上一主题 下一主题

PXE 网络化安装linux系统---原理+步骤 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-23 11:03 |只看该作者 |倒序浏览
               
                配置方法网上实在实在是很多,如果要更详细的,大家可以直接到网上找,我不会在这里写的非常详细,不会step by step的讲述,最重要的是要知道实现原理!相信看了我下面的原理讲解,能对你们看相关文档带来更大的帮助,因为真的有很多人在对着文档做的时候更本不知道自己在做什么!
流程化实现原理:
支持PXE的电脑开机(预先打开网卡PXE功能,网络引导)---> DHCP给该电脑一个IP地址,并指明下一跳tftp文件服务器 ---> 电脑去tftp服务器上(/tftpboot 文件夹下面)下载到一个叫做 pxelinux.0的文件,并拿到pxelinux.cfg文件夹下的default配置文件 ---> 根据该配置文件加载内核等操作,同时该配置文件中可以指明ks.cfg文件的地址,这样实现全程无人化安装!

基本实现步骤:
1.DHCP服务器配置
[root@localhost ~]# cat /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {
# --- default gateway
        option routers                  192.168.1.1;
        option subnet-mask              255.255.255.0;
#       option nis-domain               "domain.org";
#       option domain-name              "domain.org";
        option domain-name-servers      192.168.1.1;
        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              192.168.1.1;
#       option netbios-name-servers     192.168.1.1;
# --- 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 192.168.1.2 192.168.1.10;
        default-lease-time 21600;
        max-lease-time 43200;
        next-server 192.168.1.112;
        filename "pxelinux.0";
        # 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;
#       }
}
2.tftp服务器配置
[root@localhost ~]# cat /etc/xinetd.d/tftp
# default: off
# de.ion: 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                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
3.准备相关文件
安装目录树,ks.cfg,initrd.img,pxelinux.0,pxelinux.cfg,vmlinuz
A--把安装目录树拷贝到一个共享目录中,例如,/var/ftp/pub下面,用ftp共享
B--ks.cfg也拷贝到 /var/ftp/pub下面
C--
cp /usr/lib/syslinux/pxelinux.0 /tftpboot
cp /media/cdrom/images/pxeboot/{initrd.img,vmlinuz} /tftpboot
mkdir /tftpboot/pxelinux.cfg
touch /tftpboot/pxelinux.cfg/default
default文件内容:(ftp地址自己改)
[root@localhost ~]# cat /tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 60
display boot.msg
label linux
  kernel vmlinuz
  append initrd=initrd.img text ks=ftp://192.168.1.112/pub/ks.cfg

有问题可以和我交流,共同进步!
wangjun_job@sina.com
john.wang@chinanetcloud.com

               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93926/showart_1872660.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP