-2

At the moment, my networking team is downloading a firmware version using an FTP server (Filezilla).

We create an account on the server, upload the firmware to the server and then on the cisco device we use the command copy ftp://username:password@server_ip/file_name storage_device: and the device is downloading the firmware from the ftp server.

Now, i have a website created with Flask in python, that has some scripts that my team uses, and i want to add a script that allows the user to upload a file to the website, supply the ip of the device, and the script will connect to the device and pull the file from the server.

While creating an ftp server using pyftpdlib, i have encounterd some issues, as the device is logging in with the supplied user, but does not download the file.

If i log in to the server using an FTP client (FileZilla client) i can download the file separately.

I guess the issue is with the cisco device trying to download the firmware directly while connecting.

The code I used to create the python server:

import os

from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer

def main():
    authorizer = DummyAuthorizer()
    authorizer.add_user('username', 'password', '/ftp', perm='elradfmwMT')

    handler = FTPHandler
    handler.authorizer = authorizer
    handler.banner = "Test FTP server"

    address = ('0.0.0.0', 21)
    server = FTPServer(address, handler)

   server.max_cons = 256
   server.max_cons_per_ip = 10

   server.serve_forever()

if __name__ == '__main__':
    main()

If anyone has encounterd any issue like that, help would be appreciated.

Thank you!

moti shaku
  • 47
  • 7

1 Answers1

0

Two possible issues: 1. Watch the diskspace on the IOS device. Some platforms have very little space for extra images, so good image hygiene is essential. 2. In my various experiments, I've found that pushing the image to the device is generally more reliable than asking the device to pull the image from elsewhere. You may need to add a configuration entry "ip scp server enable". Then you can write your script to push the images diretly.