{"id":1404,"date":"2012-01-15T11:55:54","date_gmt":"2012-01-15T11:55:54","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?page_id=1404"},"modified":"2012-08-30T11:10:33","modified_gmt":"2012-08-30T10:10:33","slug":"install-tftp-server-on-centos","status":"publish","type":"page","link":"http:\/\/darenmatthews.com\/blog\/?page_id=1404","title":{"rendered":"Install TFTP server on CentOS"},"content":{"rendered":"<p>root@shimla ~]# rpm -q tftp-server<br \/>\npackage tftp-server is not installed<br \/>\n[root@shimla ~]#<br \/>\n<!--more--><br \/>\n[root@shimla ~]# yum install tftp-server<br \/>\nLoaded plugins: fastestmirror<br \/>\nLoading mirror speeds from cached hostfile<br \/>\n* base: mirror01.th.ifl.net<br \/>\n* elrepo: elrepo.reloumirrors.net<br \/>\n* extras: mirror01.th.ifl.net<br \/>\n* rpmforge: ftp-stud.fht-esslingen.de<br \/>\n* updates: mirror01.th.ifl.net<br \/>\nSetting up Install Process<br \/>\nResolving Dependencies<br \/>\n&#8211;&gt; Running transaction check<br \/>\n&#8212;&gt; Package tftp-server.x86_64 0:0.49-2.el5.centos set to be updated<br \/>\n&#8211;&gt; Finished Dependency Resolution<br \/>\n[snip]<\/p>\n<p>Installed:<br \/>\ntftp-server.x86_64 0:0.49-2.el5.centos<\/p>\n<p>Complete!<br \/>\n[root@shimla ~]#<\/p>\n<p>check to see if I also need to get xinetd:<\/p>\n<p>[root@shimla ~]# rpm -q xinetd<br \/>\nxinetd-2.3.14-13.el5<br \/>\n[root@shimla ~]#<\/p>\n<p>no I do not.<\/p>\n<p>turn &#8217;em on:<br \/>\n[root@shimla ~]# chkconfig xinetd on<br \/>\n[root@shimla ~]# chkconfig tftp on<br \/>\n[root@shimla ~]#<\/p>\n<p>[root@shimla ~]# chmod 777 \/tftpboot<br \/>\n[root@shimla ~]#<\/p>\n<p>[root@shimla ~]# ls -l \/tftpboot\/<br \/>\ntotal 0<br \/>\n[root@shimla ~]#<\/p>\n<p>[root@shimla tftpboot]# \/sbin\/chkconfig &#8211;level 345 xinetd on<br \/>\n[root@shimla tftpboot]# \/sbin\/chkconfig &#8211;level 345 tftp on<br \/>\n[root@shimla tftpboot]#<\/p>\n<p>[root@shimla tftpboot]# \/sbin\/chkconfig &#8211;list | grep tftp<br \/>\ntftp:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on<br \/>\n[root@shimla tftpboot]# \/sbin\/chkconfig &#8211;list | grep xinetd<br \/>\nxinetd\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0:off\u00a0\u00a0 1:off\u00a0\u00a0 2:on\u00a0\u00a0\u00a0 3:on\u00a0\u00a0\u00a0 4:on\u00a0\u00a0\u00a0 5:on\u00a0\u00a0\u00a0 6:off<br \/>\nxinetd based services:<br \/>\n[root@shimla tftpboot]#<\/p>\n<p>test (after having placed some Cisco phone boot files in \/tftpboot which it requires to download it&#8217;s config.\u00a0 See entry in DHCP server setup here: <a href=\"http:\/\/darenmatthews.com\/blog\/?page_id=1397\">http:\/\/darenmatthews.com\/blog\/?page_id=1397<\/a> )<\/p>\n<p>[root@shimla tftpboot]# tcpdump -i eth0 port bootpc and\u00a0 port bootps<br \/>\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br \/>\nlistening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes<br \/>\n11:54:55.434688 IP 0.0.0.0.bootpc &gt; 255.255.255.255.bootps: BOOTP\/DHCP, Request from 00:0c:30:f0:24:f1 (oui Unknown), length: 326<br \/>\n11:54:55.442409 IP 10.10.0.102.bootps &gt; 255.255.255.255.bootpc: BOOTP\/DHCP, Reply, length: 300<br \/>\n11:55:13.579211 IP 0.0.0.0.bootpc &gt; 255.255.255.255.bootps: BOOTP\/DHCP, Request from 00:0c:30:f0:24:f1 (oui Unknown), length: 326<br \/>\n11:55:13.588479 IP 10.10.0.102.bootps &gt; 255.255.255.255.bootpc: BOOTP\/DHCP, Reply, length: 300<\/p>\n<p>4 packets captured<br \/>\n4 packets received by filter<br \/>\n0 packets dropped by kernel<br \/>\n[root@shimla tftpboot]#<\/p>\n<p>listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes<\/p>\n<p>now check for tftp packets:<\/p>\n<p>[root@shimla tftpboot]# tcpdump -i eth0 port tftp<br \/>\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br \/>\nlistening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes<\/p>\n<p>0 packets captured<br \/>\n0 packets received by filter<br \/>\n0 packets dropped by kernel<br \/>\n[root@shimla tftpboot]#<\/p>\n<p>NONE seen!\u00a0 So restart dhcp daemon and check the tftp address in dhcp server options is correct:<\/p>\n<p>[root@shimla tftpboot]# service dhcpd force-reload<br \/>\nShutting down dhcpd:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [\u00a0 OK\u00a0 ]<br \/>\nStarting dhcpd:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [\u00a0 OK\u00a0 ]<\/p>\n<p>check dhcp configuration:<\/p>\n<p>[root@shimla tftpboot]# cat \/etc\/dhcpd.conf<\/p>\n<p>ddns-update-style interim;<br \/>\nignore client-updates;<\/p>\n<p>option voip-tftp-servers code 150 = ip-address;<br \/>\noption voip-tftp-servers 10.10.0.102;<\/p>\n<p>subnet 10.10.0.0 netmask 255.255.0.0 {<br \/>\noption routers\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.10.0.254;<br \/>\noption subnet-mask\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 255.255.0.0;<br \/>\noption nis-domain\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;&#8221;;<br \/>\noption domain-name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;&#8221;;<br \/>\noption domain-name-servers\u00a0\u00a0\u00a0\u00a0\u00a0 10.10.0.254;<br \/>\noption ntp-servers\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.10.0.254;<br \/>\noption tftp-server-name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;10.10.0.102&#8221;;<br \/>\nrange dynamic-bootp 10.10.0.150 10.10.0.175;<br \/>\ndefault-lease-time 3600;<br \/>\nmax-lease-time 7200;<br \/>\n}<br \/>\n[root@shimla tftpboot]# ifconfig eth0<br \/>\neth0\u00a0\u00a0\u00a0\u00a0\u00a0 Link encap:Ethernet\u00a0 HWaddr 00:30:48:BB:05:02<br \/>\ninet addr:10.10.0.102\u00a0 Bcast:10.10.255.255\u00a0 Mask:255.255.0.0<br \/>\ninet6 addr: fe80::230:48ff:febb:502\/64 Scope:Link<br \/>\nUP BROADCAST RUNNING MULTICAST\u00a0 MTU:1500\u00a0 Metric:1<br \/>\nRX packets:31055 errors:0 dropped:0 overruns:0 frame:0<br \/>\nTX packets:23123 errors:0 dropped:0 overruns:0 carrier:0<br \/>\ncollisions:0 txqueuelen:0<br \/>\nRX bytes:23586753 (22.4 MiB)\u00a0 TX bytes:7850798 (7.4 MiB)<\/p>\n<p>[root@shimla tftpboot]# tcpdump -i eth0 port tftp<br \/>\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br \/>\nlistening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes<br \/>\n12:08:43.679759 IP 10.10.0.175.51599 &gt; 10.10.0.102.tftp:\u00a0 31 RRQ &#8220;CTLSEP000C30F024F1.tlv&#8221; octet<br \/>\n12:08:43.705933 IP 10.10.0.175.51600 &gt; 10.10.0.102.tftp:\u00a0 32 RRQ &#8220;SEP000C30F024F1.cnf.xml&#8221; octet<br \/>\n12:08:43.754185 IP 10.10.0.175.51601 &gt; 10.10.0.102.tftp:\u00a0 27 RRQ &#8220;P0S3-08-9-00.loads&#8221; octet<br \/>\n12:09:08.307210 IP 10.10.0.175.51157 &gt; 10.10.0.102.tftp:\u00a0 23 RRQ &#8220;SIPDefault.cnf&#8221; octet<br \/>\n12:09:08.486613 IP 10.10.0.175.51158 &gt; 10.10.0.102.tftp:\u00a0 28 RRQ &#8220;SIP000C30F024F1.cnf&#8221; octet<br \/>\n12:09:11.713650 IP 10.10.0.175.51166 &gt; 10.10.0.102.tftp:\u00a0 21 RRQ &#8220;RINGLIST.DAT&#8221; octet<br \/>\n12:09:11.721711 IP 10.10.0.175.51167 &gt; 10.10.0.102.tftp:\u00a0 21 RRQ &#8220;dialplan.xml&#8221; octet<\/p>\n<p>7 packets captured<br \/>\n7 packets received by filter<br \/>\n0 packets dropped by kernel<br \/>\n[root@shimla tftpboot]#<\/p>\n<p>Success &#8211; and Cisco phone registered to Elastix PBX.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>root@shimla ~]# rpm -q tftp-server package tftp-server is not installed [root@shimla ~]#<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1395,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1404"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1404"}],"version-history":[{"count":7,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1404\/revisions"}],"predecessor-version":[{"id":1408,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1404\/revisions\/1408"}],"up":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1395"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}