00 - PXE | 环境准备
2024-09-06 17:57:55
00 - PXE | 环境准备
TFTP PXE
1. TFTP服务搭建
安装环境Centos7.3
1.1 安装
# yum install xinetd
# yum install tftp
# yum install tftp-server
如果不能上网,可以直接安装提供的rpm包:
sudo rpm -ivh xinetd-2.3.14-18.fc9.i386.rpm
sudo rpm -ivh tftp-0.48-3.fc9.i386.rpm
sudo rpm -ivhtftp-server-0.48-3.fc9.i386.rpm
1.2 配置
查看哪个分区空间较大,设置为tftp目录df -h
# mkdir /data/tftpboot
# chmod 777 /data/tftpboot
vim /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /data/tftpboot -c # 修改目录位置
disable = no # 修改为no
per_source = 11
cps = 100 2
flags = IPv4
}
修改/etc/sysconfig/selinux
文件,关闭selinux
SELINUX=disabled
systemctl restart xinetd
查看tftp服务是否开启:
netstat -a | grep tftp
显示结果为 udp 0 0 *:tftp : 表示服务已经开启,tftp配置成功
加入iptables
vi /etc/sysconfig/iptables
加一行
-A INPUT -p udp --dport 69 -j ACCEPT
保存
重启iptables
service iptables restart
chkconfig tftp on
chkconfig xinetd on
service xinetd restart
service tftp restart
2. 安装HTTP服务
yum install httpd
配置文件所在位置/etc/httpd/conf/httpd.conf
修改如下参数:
DocumentRoot "/data" #设定主目录
<Directory />
AllowOverride none
Require all granted # deny修改为granted
</Directory>
其他限制条件可自行搜索进行限制。
systemctl restart httpd
即可启动。
ss -tnl
可用于查看监听端口
3. 安装DHCP服务
yum install dhcp
配置文件位置/etc/dhcpd/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow unknown-clients;
allow bootp;
allow booting;
ping-check true;
default-lease-time 1800;
max-lease-time 1800;
subnet 10.24.10.0 netmask 255.255.255.128 {
option routers 10.24.10.126;
option subnet-mask 255.255.255.128;
next-server 10.24.16.151;
range dynamic-bootp 10.24.10.41 10.24.10.80;
filename "/pxelinux.0";
}
shared-network 10.25.18.128 {
subnet 10.25.18.128 netmask 255.255.255.128 {
option routers 10.25.18.254;
option subnet-mask 255.255.255.128;
next-server 172.18.5.73;
range dynamic-bootp 10.25.18.170 10.25.18.210;
filename "/pxelinux.0";
}
host server_SN {
next-server 172.18.5.73;
hardware ethernet server_ILO_MAC;
fixed-address 10.25.18.150;
filename "/pxelinux.0";
}
监听端口/etc/sysconfig/dhcpd
修改里面的DHCPDARGS=
参数。假如需要监听多个端口,则建议不要填写。
DHCP服务一定要把本机网口所在的网段写入到dhcp.conf中,否则服务起不来
最新文章
- SpringMVC + Spring + MyBatis 整合 + Spring shrio + easyUI + 权限管理框架,带shrio session和shrio cache集群实现方案
- 修改mysql某一键为自增键
- HTML网页内容转换成字符串(删除从指定字符串到指定字符串)
- CentOS系统启动流程你懂否
- WP8.1下 Cortana语音命令 VCD文件 设计
- 如何破解UltraEdit
- 总结Selenium自动化测试方法(五)自动化测试框架
- 一道JAVA经典面试题目的两种解法
- PHP如何取出数组最后一个元素?
- 学习protobuf
- SimpleDateFormat的部分方法
- 转:CSV Data Set Config 中文乱码问题
- [git] 细说commit (git add/commit/diff/rm/reset 以及 index 的概念)
- java数组集合元素的查找
- Rancher之HA部署
- P3261 [JLOI2015]城池攻占
- 求组合数 C++程序
- Python基础--数据类型
- PHP的线性安全和非线性安全的区别
- 【BZOJ 2144】 2144: 跳跳棋 (倍增LCA)