• jcnetworking
  • LONDON
OTHERS
Run TFTP Server in AWS for Switch/ Router firmware upgrade

Run TFTP Server in AWS for Switch/ Router firmware upgrade

Run TFTP Server in AWS – Ubuntu

Upgrade switch/ Router frimware, you can use by USB/ TFTP

  • USB – You can do Copy usbflash0: flash:latest firmware. Which is very useful, when there is 1 or 2 machine.
  • TFTP – If you forget your USB, that’s okay. As the firmware is in the cloud.

Figure 1.1 & 1.2 <- Create a VM in AWS, but this time. you can run a script before (“you can find it in figure 1.2”. AWS will run the commands on your Linux before your machine is ready.

Figure 1.1
Figure 1.2

SETUP Ubuntu

By Running the scripting at figure 1.2, TFTP Server will be installed. But we still need to do some setting on the tftpd.

  • When you type ” sudo service tftpd-hpa status” it will show the app Status.
  • When the app is running , which mean it is good. it is installed properly
  • Next we need to change some setting on tftp file
  • Type “sudo nano /etc/default/tftpd-hpa”
  • TFTP_DIRECTORY & TFTP_OPTIONS need to be changed as per figure 2.2
  • TFTP_Directory -> which mean where will your files stored
  • TFTP_OPTIONS -> added “–create” which is allowed to post files to your linux
Figure 2.1
Figure 2.2

Backup Image

Let’s Create Templates on your EC2 instance. It will store the configuration on your machine. If you created a website with this instance, you can use this image as auto scaling.

Figure 3.1
Figure 3.2

Test on Cisco Router

TFTP Server is setup in AWS, Its Public IP address is 13.40.33.123

I run a Cisco router to test the tftp server.

Figure 4.1 – Using “Copy flash: tftp” to test, sending files to TFTP.

Figure 4.2 & 4.3 – Get the file from TFTP Server and transfer files to TFTP Server.

Right hand side Black screen is TFTP Server <- using “ls -la” to check the files in directory.

LEFT hand side Blue screen is Router screen <- using ” show flash:” to check files in the Flash

Figure 4.1
Figure 4.2
Figure 4.3

SECURE LINUX

In Linux, it got his own firewall – UFW

Figure 5.1 – by default, UFW is inactive.

Figure 5.2 & 5.3 – you can add allow port and enable UFW. Don’t forget to add port 22, if not you will not login to your machine again.

Figure 5.4 – using “grep tftp /var/log/syslog” you can check the logs for tftp, which records the history Get, Put…etc

Figure 5.1
Figure 5.2
Figure 5.3
Figure 5.4

While AWS does Free Tier at first 12 months, we can run a TFTP Server in the cloud. It will not cost any technically, at the same time, we can practice our cloud skill.

2 thoughts on “Run TFTP Server in AWS for Switch/ Router firmware upgrade

    • Author gravatar

      Hi Joe,

      Thanks a lot for posting this. I followed the steps but kept getting ‘Transfer timed out’ when i am trying to ”get’ or ‘put’ files from/to the TFTP server. Any ideas what may caused the issue? Thank you!

      • Author gravatar

        Thanks for your comment buddy 😉

        If you run the server in AWS. Few things you need to check
        – security group is it allow the traffic
        – on linux itself, did you turn on the firewall
        – also you can use TCPDUMP to the traffic, is it hitting your server
        – and your router/switch do have internet access

Leave a Reply

Your email address will not be published. Required fields are marked *