Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


Mininet: running FTP commands on the host

asked 2015-08-08 04:42:44 -0700

Fizza555 gravatar image

I have created a simple topology (two hosts and a switch). h1 is the FTP server and h2 is the FTP client. FTP server is installed by sudo apt-get install ftpd and started by the command inetd &.

All of these steps at the hosts are done from inside the topology file. Here is the code snippet:

host1 = net.get('h1') 
host1.cmd('inetd &')

host2 = net.get('h2')

At this point, host2 needs to enter the username and password of host1 in order to establish the FTP session and then get the file from the FTP sever(host1). The username and password both are 'mininet'.

How can I do this? I have tried doing it like this, but it does not work this way.

host2 = net.get('h2')
host2.cmd('mininet') #for username 
host2.cmd('mininet') #for password
host2.cmd('get myfile')#for getting the file myfile

Please help me find a solution to this.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-08-09 05:31:32 -0700

happysmile gravatar image

Try doing it in one cmd, it must work. Install lftp and then:

lftp -u username,password -e "your command;quit"
edit flag offensive delete publish link more


lftp displays only the number of bytes transferred after a successful file transfer. Is there some option to display the time taken in transferring the files ?

Fizza555 ( 2015-08-10 08:38:50 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-08-08 04:42:44 -0700

Seen: 902 times

Last updated: Aug 09 '15