CentOS7, TFTP server 설치 사용하기.
작업환경: CentOS 7, firewalld 사용안함, selinux 사용안함.
tftp서버는 xinetd에 의해 제어되기때문에, xinetd도 함께 설치해야한다.
# yum install tftp-server xinetd
xinetd의 tftp 설정확인.(기본 tftp root 디렉토리를 변경하려면, 아래 14번 줄의 /var/lib/tftpboot를 변경하면된다.)
# cat /etc/xinetd.d/tftp
# default: off
# description: 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 /var/lib/tftpboot
disable = yes
per_source = 11
cps = 100 2
flags = IPv4
}
/usr/lib/systemd/system에서 tftp.service 확인.기본 tftp root 디렉토리를 변경하려면, 아래 8번 줄의 /var/lib/tftpboot를 변경하면된다.)
# cat tftp.service [Unit] Description=Tftp Server Requires=tftp.socket Documentation=man:in.tftpd [Service] ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpboot StandardInput=socket [Install] Also=tftp.socket
xinetd와 tftp 서버를 실행한다.
# systemctl start xinetd # systemctl start tftp
listen 포트를 확인해 본다.(udp 69포트)
# netstat -anu Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State udp6 0 0 :::69 :::*
재부팅시 자동으로 tftp서버를 실행하려면 아래 명령을 내리면 된다.
# systemctl enable xinetd # systemctl enable tftp