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中,否则服务起不来

最新文章

  1. SpringMVC + Spring + MyBatis 整合 + Spring shrio + easyUI + 权限管理框架,带shrio session和shrio cache集群实现方案
  2. 修改mysql某一键为自增键
  3. HTML网页内容转换成字符串(删除从指定字符串到指定字符串)
  4. CentOS系统启动流程你懂否
  5. WP8.1下 Cortana语音命令 VCD文件 设计
  6. 如何破解UltraEdit
  7. 总结Selenium自动化测试方法(五)自动化测试框架
  8. 一道JAVA经典面试题目的两种解法
  9. PHP如何取出数组最后一个元素?
  10. 学习protobuf
  11. SimpleDateFormat的部分方法
  12. 转:CSV Data Set Config 中文乱码问题
  13. [git] 细说commit (git add/commit/diff/rm/reset 以及 index 的概念)
  14. java数组集合元素的查找
  15. Rancher之HA部署
  16. P3261 [JLOI2015]城池攻占
  17. 求组合数 C++程序
  18. Python基础--数据类型
  19. PHP的线性安全和非线性安全的区别
  20. 【BZOJ 2144】 2144: 跳跳棋 (倍增LCA)

热门文章

  1. 跟Evan学Sprign编程思想 | Spring注解编程模式【译】
  2. 八、django学习之分组查询、F查询和Q查询
  3. MySql新版本安装配置
  4. 开源项目SMSS发开指南(五)——SSL/TLS加密通信详解(下)
  5. [urllib]urlretrieve在python3
  6. POJ_2752_KMP
  7. java9循环结构进阶
  8. Golang设置https访问,以及http如何重定向到https
  9. Go语言实现:【剑指offer】顺时针打印矩阵
  10. O准备如何苟进复赛圈?华为软挑开挂指南(附赛题预测)