PDA

View Full Version : not able to setup tftp server


fpmurphy
10th May 2010, 02:39 PM
You are running tftpd as an on demand server i.e. it is only fired up when it is needed. Services run by xinetd are always run on demand.

Have you actually tested if tftp on another system can access your PC i.e.

tftp your_pc_ip_address

pabloguevara
17th May 2010, 11:45 PM
Since I usually start tftp when I need it only, i usually run the tftp server as a deamon instead of as a service. When I investigated why I could not run tftp as a service, I ended up discovering that SELinux is blocking it. If you disabled SELinux and you configure TFTP and firewall, it will work as a service. Below my instructions to make tftp work as deamon, tested from FC4 to FC12:

1) # yum install tftp-server
2) # service xinetd restart
3) Allow port udp 69 on FIREWALL (on "iptables --list-rules" you should see a line like this "-A INPUT -p udp -m state --state NEW -m udp --dport 69 -j ACCEPT")
4) #optional install tftp client # yum install tftp atftp
5) check log if needed # tail -f /var/log/messages
6) as root # chkconfig tftp off
7) as root # /usr/sbin/in.tftpd -l -a 192.168.1.143:69 -c -s /var/tftpboot
8) as root # chkconfig tftp on
9) verify port 69 # netstat --proto=inet,inet6 -pnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:52937 0.0.0.0:* LISTEN 4500/skype
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2647/rpcbind
tcp 0 0 127.0.0.1:29746 0.0.0.0:* LISTEN 6605/cvpnd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 3317/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3059/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3275/cupsd
tcp 0 0 0.0.0.0:43640 0.0.0.0:* LISTEN 2660/rpc.statd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 23958/sendmail: acc
tcp 0 0 :::111 :::* LISTEN 2647/rpcbind
tcp 0 0 :::80 :::* LISTEN 3142/httpd
tcp 0 0 :::22 :::* LISTEN 3059/sshd
tcp 0 0 ::1:631 :::* LISTEN 3275/cupsd
tcp 0 0 :::443 :::* LISTEN 3142/httpd
udp 0 0 0.0.0.0:42254 0.0.0.0:* 6605/cvpnd
udp 0 0 0.0.0.0:50327 0.0.0.0:* 2660/rpc.statd
udp 0 0 127.0.0.1:29746 0.0.0.0:* 6605/cvpnd
udp 0 0 192.168.122.1:53 0.0.0.0:* 3317/dnsmasq
udp 0 0 0.0.0.0:702 0.0.0.0:* 2647/rpcbind
udp 0 0 0.0.0.0:67 0.0.0.0:* 3317/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 4379/dhclient
udp 0 0 192.168.1.143:69 0.0.0.0:* 25058/in.tftpd
udp 0 0 0.0.0.0:52937 0.0.0.0:* 4500/skype
udp 0 0 0.0.0.0:717 0.0.0.0:* 2660/rpc.statd
udp 0 0 0.0.0.0:36824 0.0.0.0:* 3244/avahi-daemon:
udp 0 0 0.0.0.0:5353 0.0.0.0:* 3244/avahi-daemon:
udp 0 0 0.0.0.0:111 0.0.0.0:* 2647/rpcbind
udp 0 0 0.0.0.0:56563 0.0.0.0:* 6605/cvpnd
udp 0 0 0.0.0.0:631 0.0.0.0:* 3275/cupsd
udp 0 0 127.0.0.1:33022 0.0.0.0:* 4500/skype
udp 0 0 :::702 :::* 2647/rpcbind
udp 0 0 :::111 :::* 2647/rpcbind

Once you verify it's runing, next time you need it just run as root

chkconfig tftp off
/usr/sbin/in.tftpd -l -a 192.168.1.143:69 -c -s /var/tftpboot
chkconfig tftp on

And that's it (or course change the ip and directory to what ever you need it to be). Hope it helps...

pabloguevara
18th May 2010, 07:01 PM
Verify interface is up and ip configured

[root@localhost ~]# ifconfig eht0
eth0 Link encap:Ethernet HWaddr 00:15:C5:3A:B9:72
inet addr:192.168.1.143 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::215:c5ff:fe3a:b972/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1280 (1.2 KiB) TX bytes:5325 (5.2 KiB)
Interrupt:18

Then just do:

bash-4.0$ sudo chkconfig tftp off
[sudo] password for pablo:
bash-4.0$
bash-4.0$ sudo /usr/sbin/in.tftpd -l -a 192.168.1.143:69 -c -s /var/tftp/1.16.2.318/
bash-4.0$ sudo chkconfig tftp on
bash-4.0$
bash-4.0$ netstat --proto=inet,inet6 -pnl
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:50927 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN -
tcp 0 0 :::111 :::* LISTEN -
tcp 0 0 :::22 :::* LISTEN -
tcp 0 0 ::1:631 :::* LISTEN -
udp 0 0 192.168.122.1:53 0.0.0.0:* -
udp 0 0 0.0.0.0:67 0.0.0.0:* -
udp 0 0 0.0.0.0:37699 0.0.0.0:* -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 192.168.1.143:69 0.0.0.0:* -
udp 0 0 0.0.0.0:727 0.0.0.0:* -
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp 0 0 0.0.0.0:111 0.0.0.0:* -
udp 0 0 0.0.0.0:631 0.0.0.0:* -
udp 0 0 0.0.0.0:56457 0.0.0.0:* -
udp 0 0 0.0.0.0:783 0.0.0.0:* -
udp 0 0 :::727 :::* -
udp 0 0 :::111 :::* -

I must confes I did not run this on fc12 until yestedday, and I did find the same issue as you. But after making sure my interface was up and my IP configured, it worked (I also rebooted the PC, but not because of this).

To transfer files using tftp also make sure that permissions are 777 for the files you want to transfer, and user:group is nobody:nobody.

It's working for me. Good luck.

---------- Post added at 03:01 PM CDT ---------- Previous post was at 02:58 PM CDT ----------

I also wanted to mention that when I tried to use a folder on my home, like /home/pablo/tftp, it did not work. I do not have the time to check why this is, but it's working with /var/tftp or /var/tftpboot.

Also, I could not set permissions on /home/pablo/tftp to 777 and user:group to nobody:nobody, even though I was logged in as root.... strange. If someone knows why this is, an explanation would be welcomed.

Ascot Travel Photos - Mutuali - Hongjiang Instagram Photos