pxe安装linux原理,PXE 网络化安装Linux系统——原理+步骤

PXE 网络化安装Linux系统配置方法网上实在实在是很多,如果要更详细的,大家可以直接到网上找,我不会在这里写的非常详细,不会step by step的讲述,最重要的是要知道实现原理!相信看了我下面的原理讲解,能对你们看相关文档带来更大的帮助,因为真的有很多人在对着文档做的时候更本不知道自己在做什么!

流程化实现原理:

支持PXE的电脑开机(预先打开网卡PXE功能,网络引导)---> DHCP给该电脑一个IP地址,并指明下一跳tftp文件服务器 ---> 电脑去tftp服务器上(/tftpboot 文件夹下面)下载到一个叫做 pxelinux.0的文件,并拿到pxelinux.cfg文件夹下的default配置文件 ---> 根据该配置文件加载内核等操作,www.britepic.org同时该配置文件中可以指明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,vmlinuzA--把安装目录树拷贝到一个共享目录中,例如,/var/ftp/pub下面,用ftp共享B--ks.cfg也拷贝到 /var/ftp/pub下面C--cp /usr/lib/syslinux/pxelinux.0 /tftpbootcp /media/cdrom/images/pxeboot/{initrd.img,vmlinuz} /tftpbootmkdir /tftpboot/pxelinux.cfgtouch /tftpboot/pxelinux.cfg/defaultdefault文件内容:(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.cfg0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值