tftp configuration

[root@aserver ~]# yum install tftp-server xinetd -y

[root@aserver ~]# systemctl status tftp
● tftp.service – Tftp Server
Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
Active: inactive (dead)
Docs: man:in.tftpd

[root@aserver ~]# systemctl start tftp

[root@aserver ~]# systemctl status tftp
● tftp.service – Tftp Server
Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
Active: active (running) since Sat 2016-11-19 06:57:03 EST; 2s ago
Docs: man:in.tftpd
Main PID: 2133 (in.tftpd)
CGroup: /system.slice/tftp.service
└─2133 /usr/sbin/in.tftpd -s /var/lib/tftpboot

Nov 19 06:57:03 aserver.example.org systemd[1]: Started Tftp Server.
Nov 19 06:57:03 aserver.example.org systemd[1]: Starting Tftp Server…

[root@aserver ~]# systemctl status xinetd
● xinetd.service – Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2016-11-19 06:54:16 EST; 3min 22s ago
Process: 956 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
Main PID: 961 (xinetd)
CGroup: /system.slice/xinetd.service
└─961 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

Nov 19 06:54:16 aserver.example.org xinetd[961]: removing discard
Nov 19 06:54:16 aserver.example.org xinetd[961]: removing discard
Nov 19 06:54:16 aserver.example.org xinetd[961]: removing echo
Nov 19 06:54:16 aserver.example.org xinetd[961]: removing echo
Nov 19 06:54:16 aserver.example.org xinetd[961]: removing tcpmux
Nov 19 06:54:16 aserver.example.org xinetd[961]: removing tftp
Nov 19 06:54:16 aserver.example.org xinetd[961]: removing time
Nov 19 06:54:16 aserver.example.org xinetd[961]: removing time
Nov 19 06:54:16 aserver.example.org xinetd[961]: xinetd Version 2.3.15 started with libwrap loadavg labeled-networking options compiled in.
Nov 19 06:54:16 aserver.example.org xinetd[961]: Started working: 0 available services

[root@aserver ~]# netstat -tulp |grep tftp
udp6 0 0 [::]:tftp [::]:* 1/systemd

[root@aserver ~]# 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
}

[root@aserver ~]# vim /etc/xinetd.d/tftp
disable = no

[root@aserver ~]# service xinetd restart
Redirecting to /bin/systemctl restart xinetd.service

[root@aserver ~]# yum install tftp -y

[root@aserver ~]# yum install lsof -y

Complete!
[root@aserver ~]# lsof -i:69
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1 root 36u IPv6 16991 0t0 UDP *:tftp
in.tftpd 2133 root 0u IPv6 16991 0t0 UDP *:tftp
xinetd 2179 root 5u IPv4 17889 0t0 UDP *:tftp

[root@aserver ~]# vim /var/lib/tftpboot/one.txt
hai is to test tftp

[root@aserver ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:62:c0:ef brd ff:ff:ff:ff:ff:ff
inet 192.168.43.133/24 brd 192.168.43.255 scope global dynamic eno16777736
valid_lft 1785sec preferred_lft 1785sec
inet6 fe80::20c:29ff:fe62:c0ef/64 scope link
valid_lft forever preferred_lft forever
mohammedrafi@NOC-RAFI:~$ sudo apt-get install tftp
mohammedrafi@NOC-RAFI:~$ tftp 192.168.43.133
tftp> get one.txt
Received 23 bytes in 0.0 seconds
tftp> quit

mohammedrafi@NOC-RAFI:~$ cat one.txt
hai is to test tftp
mohammedrafi@NOC-RAFI:~$ vim upload
this is upload from client

mohammedrafi@NOC-RAFI:~$ tftp 192.168.43.133 -c put upload
usage: tftp host-name [port]
tftp> quit

mohammedrafi@NOC-RAFI:~$ getent services tftp
tftp 69/udp

[root@aserver ~]# getent services tftp
tftp 69/tcp

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s