LSPro建立PXE环境
2024-09-05 10:12:28
一、安装和配置tftp服务
1、安装tftp-hpa
ipkg install tftp-hpa
tftp-hpa主要的配置文件有两个:
/opt/etc/xinetd.conf
/opt/etc/xinetd.d/tftp
前者的内容如下,基本无需作任何修改:
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Sample configuration file for xinetd defaults
{
only_from = localhost 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
instances = 60
log_type = SYSLOG authpriv info
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
} includedir /opt/etc/xinetd.d
后者的内容如下:
#
# ftp://ftp.kernel.org/pub/software/network/tftp/
#
service tftp
{
flags = REUSE
socket_type = dgram
protocol = udp
instances = 30
wait = yes
user = root
server = /opt/sbin/in.tftpd
server_args = -s /opt/tftpboot
cps = 100 2
log_on_success = HOST PID
log_on_failure = HOST
disable = no
}
一般只需要server_args这个参数值,它定义tftp服务的默认工作目录。
2、配置tftp服务
2.1 设置tftp工作目录
先在根目录下建立工作目录tftpboot
mkdir /tftpboot
修改配置文件/opt/etc/xinetd.d/tftp,将server_args的值改为/tftpbooot.
2.2 建立tftp配置文件目录
先在tftp工作目录下,建立配置文件目录
mkdir -p /tftpboot/pxelinux.cfg
再创建一个配置文件
vi /tftpboot/pxelinux.cfg/default
文件内容如下:
default menu.c32 prompt 0
timeout 50
ONTIMEOUT localboot MENU TITLE PXE Menu LABEL localboot
MENU LABEL Boot From Hard Disk
LOCALBOOT 0 LABEL CentoS 5.4 i386 Installer
MENU LABEL CentOS 5.4 i386 Installer
KERNEL images/centos/i386/5.4/vmlinuz
append vga=normal initrd=images/centos/i386/5.4/initrd.img ramdisk_size=32768
3、启动tftp服务
/opt/etc/init.d/S10xinetd
如果无法启动,可查看/var/log/message寻找原因进行排除。
二、安装和配置DHCP服务
1、安装dhcp服务
ipkg install dhcp
2、配置dhcp服务
dhcp服务的配置文件为:/opt/etc/dhcpd.conf
先备份一下
cp /opt/etc/dhcpd.conf /opt/etc/dhcpd.conf.bak
打开dhcpd.conf
vi /opt/etc/dhcpd.conf
输入以下内容:
要配合PXE引导,dhcp的配置文件中必须包含以下几行配置
allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;
next-server xxx.xxx.xxx.xxx; //IP of My PXE Server
filename "/pxelinux.0";
然后重新启动dhcp服务
/opt/etc/init.d/S56dhcp
最新文章
- filter-自己的理解
- Kali Linux渗透基础知识整理(二)漏洞扫描
- OpenCV 3.0 CvMat and cv::Mat Conversion
- 12. Linux在线升级yum
- uva 297 quadtrees——yhx
- C++-模板的声明和实现为何要放在头文件中
- 自定义事件解决重复请求BUG
- javascript面向对象编程(OOP)——汇总
- Django 【认证系统】auth
- nodeJs express mongodb 建站(window 10 版)
- MySQL--pymysql模块
- JVM探秘2--详解内存溢出OutOfMemoryError异常
- fortitoken
- MySQL语言 数据库练习题分解。
- 了解Redis过期策略及实现原理
- 【python54--爬虫2】
- Andriod——手机尺寸相关的概念 +尺寸单位+关于颜色
- 【angular5项目积累总结】结合adal4实现http拦截器(token)
- scope_identity() 与 @@identity的区别
- sicily 1231. The Embarrassed Cryptography
热门文章
- delphi ADOCONNECTION异常拦截
- Python把json格式的string对象转变成dict对象操作、Python3不能使用urllib2、urllib.parse.urlencode(params).encode(encoding='UTF8')
- springboot-定时任务-单线程
- 3年磨一剑,我的前端数据 mock 库 http-mock-middleware
- 【AMAD】django-allauth
- 性能排查--CPU占用高
- 关于Dev-c++运行时与Windows不兼容问题
- Javascript学习笔记二——操作DOM
- [bzoj2597][Wc2007]剪刀石头布_费用流
- 怎么将本地项目放到码云(gitee)上面?图文详解