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

0

Mininet: running FTP commands on the host

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

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')
host2.cmd('ftp 10.0.0.1')
...

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('ftp 10.0.0.1')
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.

Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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

happysmile gravatar image

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

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

Comments

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 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

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

Seen: 641 times

Last updated: Aug 09 '15