{"id":1713,"date":"2019-04-23T22:22:00","date_gmt":"2019-04-23T21:22:00","guid":{"rendered":"https:\/\/www.balajibandi.com\/?p=1713"},"modified":"2022-09-17T13:55:59","modified_gmt":"2022-09-17T12:55:59","slug":"tftp-blocksize-issue-with-cisco-devices-fix","status":"publish","type":"post","link":"https:\/\/www.balajibandi.com\/?p=1713","title":{"rendered":"TFTP Blocksize issue with Cisco devices &#8211; Fix!"},"content":{"rendered":"\n<p>Install simple TFTP Server on my Linux Ubunut <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install tftpd-hpa\n\nThe default configuration file for tftpd-hpa is \/etc\/default\/tftpd-hpa\nI have config as below :\n\n# \/etc\/default\/tftpd-hpa\n\nTFTP_USERNAME=\"tftp\"\n#TFTP_DIRECTORY=\"\/var\/lib\/tftpboot\"\nTFTP_DIRECTORY=\"\/tftp\"\nTFTP_ADDRESS=\"0.0.0.0:69\"\nTFTP_OPTIONS=\"--secure --create  --blocksize 8192 -v\"\n\nThe default root directory where files will be stored is \/var\/lib\/tftpboot, Now i have changed to \/tftp\n\n<strong>mkdir \/tftp<\/strong>\n<strong>chown -R tftp \/tftpboot<\/strong>\n\n<strong>service tftpd-hpa restart<\/strong>\n\n<strong># \/etc\/init.d\/tftpd-hpa status<\/strong>\n\u25cf tftpd-hpa.service - LSB: HPA's tftp server\n   Loaded: loaded (\/etc\/init.d\/tftpd-hpa; generated)\n   Active: active (running) since XXXXXXXXX BST; 9min ago\n     Docs: man:systemd-sysv-generator(8)\n  Process: 11130 ExecStop=\/etc\/init.d\/tftpd-hpa stop (code=exited, status=0\/SUCCESS)\n  Process: 11263 ExecStart=\/etc\/init.d\/tftpd-hpa start (code=exited, status=0\/SUCCESS)\n    Tasks: 1 (limit: 4915)\n   CGroup: \/system.slice\/tftpd-hpa.service\n           \u2514\u250011283 \/usr\/sbin\/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure --create --blocksize 8192 -v \/tftp\n\nBB-SYSLOG systemd[1]: Starting LSB: HPA's tftp server...\nBB-SYSLOG tftpd-hpa[11263]:  * Starting HPA's tftpd in.tftpd\nBB-SYSLOG tftpd-hpa[11263]:    ...done.\nBB-SYSLOG systemd[1]: Started LSB: HPA's tftp server.\n\nTry testing TFTP from Cat 9300 - You see error not able to write to TFTP\n\n<strong>#copy running-config tftp:<\/strong>\nAddress or name of remote host []? 10.188.194.55\nDestination filename [bb-fes-01-confg]?\n!.....\n%Error writing tftp:\/\/10.188.194.55\/bb-fes-01-confg (Timed out)!\n\nwhen i do the TCPDUMP on Linux, the switch try to send files using blocksize of 8192\n\n# tcpdump port 23 or port 69\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\nlistening on enp40s0f0, link-type EN10MB (Ethernet), capture size 262144 bytes\nBB-SWITCH.50158 &gt; BB-SYSLOG.gstt.local.tftp:  <strong>44<\/strong> WRQ \"bb-fes-01-confg\" octet <strong>blksize 8192<\/strong>\n\nThis what i found to be failing.\n\nOn switch change block size :\nconfig t\n!\nip tftp block 512\n!\nend\n\nNote : from switch you able to get blocksize 8192 to transfer files to switch. from switch confif writing file to tftp having issue, so change required to blocksize to 512.\n\nLets try now :\n\n#copy running-config tftp:\nAddress or name of remote host []? 10.188.194.55\nDestination filename [bb-fes-01-confg]?\n!!\n19860 bytes copied in 1.507 secs (13179 bytes\/sec)\n\n# tcpdump port 23 or port 69\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\nlistening on enp40s0f0, link-type EN10MB (Ethernet), capture size 262144 bytes\nBB-FES-01.51590 &gt; SP-PR-SYSLOG.gstt.local.tftp:  44 WRQ \"bb-fes-01-confg\" octet blksize 8192\nBB-FES-01.54802 &gt; SP-PR-SYSLOG.gstt.local.tftp:  44 WRQ \"bb-fes-01-confg\" octet blksize 8192\n<strong>BB-FES-01.54677 &gt; SP-PR-SYSLOG.gstt.local.tftp:  31 WRQ \"bb-fes-01-confg\" octet<\/strong>\n\n\n\n\n\n\n\n\n\n\n\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Install simple TFTP Server on my Linux Ubunut apt-get install tftpd-hpa The default configuration file for tftpd-hpa is \/etc\/default\/tftpd-hpa I have config as below : # \/etc\/default\/tftpd-hpa TFTP_USERNAME=&#8221;tftp&#8221; #TFTP_DIRECTORY=&#8221;\/var\/lib\/tftpboot&#8221; TFTP_DIRECTORY=&#8221;\/tftp&#8221; TFTP_ADDRESS=&#8221;0.0.0.0:69&#8243; TFTP_OPTIONS=&#8221;&#8211;secure &#8211;create &#8211;blocksize 8192 -v&#8221; The default root directory where files will be stored is \/var\/lib\/tftpboot, Now i have changed to \/tftp mkdir \/tftp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1713","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/1713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1713"}],"version-history":[{"count":1,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/1713\/revisions"}],"predecessor-version":[{"id":1714,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/1713\/revisions\/1714"}],"wp:attachment":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}