Install TFTP Server

From WiDirect
Jump to: navigation, search

Installing the TFTP server on a WiDirect or WiClient is easy. First run the commands to install and start the necessary services:

sudo yum install atftp-server xinetd
sudo chkconfig tftp on
sudo chkconfig xinetd on
sudo service xinetd start

Next the firewall needs to have port 69 enabled. Both TCP and UDP is recommended. Open the firewall file:

emacs /etc/sysconfig/iptables

Add two lines with the other input rules to allow traffic on port 69:

-A INPUT -m tcp -p tcp --dport 69 -j ACCEPT
-A INPUT -m udp -p udp --dport 69 -j ACCEPT

You will also want to modify the iptables configuration file:

sudo emacs /etc/sysconfig/iptables-config

The IPTABLES_MODULES line needs to be updated to include ip_conntrack_tftp:

IPTABLES_MODULES="ip_conntrack_netbios_ns ip_nat_ftp ip_conntrack_ftp ip_conntrack_tftp"

Restart the necessary services:

sudo service iptables restart
sudo service awicp_client restart

The TFTP server is now ready to use. Add the desired files to /tftpboot/.

The DHCP server can be set to tell the users about the TFTP server by adding in additional lines to the DHCP configuration:

option next-server "10.4.1.1";
option filename "startfile";

Those lines can be added either to the subnet section, or as a separate group:

subnet 10.4.1.0 netmask 255.255.255.0 {
    range 10.4.1.20 10.4.1.254;
    next-server 10.4.1.1;
    filename "startfile";
    option routers 10.4.1.1;
    option domain-name-servers 10.4.1.1;
    option ntp-servers 10.4.1.1;
    option subnet-mask 255.255.255.0;
}

or

group {
    filename "startfile";
    next-server 10.4.1.1;
    host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; }
    host ncd4 { hardware ethernet 0:c0:c3:80:fc:32; }
    host ncd8 { hardware ethernet 0:c0:c3:22:46:81; }
}