Thursday, December 29, 2011

Install TFTP Server on CentOS

Recently did some new installation on CentOS 5.6 machine with TFTP server..
For more information regarding TFTP, kindly refer to the following link..

My main reason to build a tftp server due to perform some backup server for my Cisco and Netscaler devices..
Been google all day long and at last found few nice written and well explain site that able complete my task..

Here are the steps... *sorry if my English is written in bad way..@@

1. do install tftp server, it will run together with xinetd services.
yum install tftp-server

2. move the tftpboot directory for your own easy maintain purpose. I used to located all my datafile at /var/lib. So will run the command as..
mv /tftpboot/ /var/lib/

3. Change the ownership and folder permission for tftpboot. It will run as nobody user with permission 777..
chown -R nobody:nobody /var/lib/tftpboot/
chmod 777 /var/lib/tftpboot/

4. Edit the tftp file at /etc/xinetd.d/tftp
vi /etc/xinetd.d/tftp

Then add and edit the file to have same line..
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -c -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

For the server_args, change the path to your tftpboot location. Add -c to able creating new file if/no file exist on the tftp server.

5. Start the xinetd service
service xinetd start

6. Able to see the port 69 exist when running
netstat -ntulp

7. Add iptables policy to allow port 69 udp.
-A RH-Firewall-1-INPUT -s (TFTP Subnet) -m udp -p udp --dport 69 -j ACCEPT

That all.. Can try do some file transfer from the client to server..

Will continue in next post.. how the transfer can be done from Cisco, Netscaler and Linux machine to the TFTP Server.


3 comments:

Anonymous said...

thank a lot it helped

Anonymous said...

The help me out also. Great post.

zabera said...

Thank You Man!. Is really helpful.

You save my Life!