TFTP (Trivial File Transfer Protocol) is a simple File Transfer Protocol that allows a client to get or put a file to a remote host.
It's an old protocol, but still used in many network applications.
Personnaly, I use it to update the firmware on my network equipment. (Cisco switches for examples).
Here"s how to set up a TFTP server under Debian.
root@server:~# apt update
root@server:~# apt install atftpd
root@server:~# ls /srv/tftp || mkdir -p /srv/tftp
allow-hotplug ens224
iface ens224 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 192.168.1.254
root@host:~# systemctl restart networking
USE_INETD=true
# OPTIONS below are used only with init script
OPTIONS="--tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /srv/tftp"
root@server:~# systemctl restart atftpd.service
root@server:~# chmod -R ugo+rw /srv/tftp/
To check that our server is working properly, we can use a tftp client.
root@client:~# apt update && apt install tftp
user@client:~$ tftp 192.168.1.10
tftp> status
Connected to 192.168.1.10.
ode: netascii Verbose: off Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp> get c1000-universalk9-mz.152-7.E4.bin
tftp> put c1000-universalk9-mz.152-7.E4.bin
tftp> quit
In some situations, it may be necessary to set up a DHCP server, we we'll show you how.
root@client:~# apt update && apt install isc-dhcp-server
option domain-name "example.org";
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.10 192.168.10.20;
}
INTERFACESv4="ens224"
#INTERFACESv6=""
root@client:~# systemctl restart isc-dhcp-server.service
root@client:~# grep dhcpd /var/log/syslog
Contact :