TFTP是简单文件传输协议,PXE部署过程中用来传输初始启动程序、内核及配置文件。
以下实验在CENTOS 7.2上完成
[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[[email protected] ~]# uname -r
3.10.0-327.10.1.el7.x86_64
YUM直接安装
[[email protected] ~]# yum -y install tftp-server
RPM检查配置文件路径
[[email protected] ~]# rpm -qc tftp-server
/etc/xinetd.d/tftp
修改配置文件
disable改为no启用tftp服务
-c 允许tftp写入
-vvv记录详细日志,此参数在写在最后
/var/lib/tftpboot是默认tftp主目录,如果修改此路径要记得设置selinux相关权限
disable = no
server_args = -s -c /var/lib/tftpboot -vvv
修改完配置文件后重启守护进程xinetd生效
[email protected] ~]# systemctl restart xinetd.service
配置开机自动运行xinetd进程
[[email protected] ~]# systemctl enable xinetd.service
检查xinetd启动状态
[[email protected] ~]# systemctl status xinetd.service
● xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2016-03-10 08:51:30 EST; 17s ago
防火墙开启的话允许tftp流量,perment参数表示永久生效,无此参数此防火墙规则在重启后失效。
firewall-cmd --add-service=tftp --permenent
重启防火墙服务,生效上述规则
[[email protected] ~]# systemctl restart firewalld.service
检查tftp端口监听状态
ss -ul | grep tftp
[[email protected] ~]# ss -ul | grep tftp
UNCONN 0 0 *:tftp *:*
UNCONN 0 0 :::tftp :::*