mininet-wifi icon indicating copy to clipboard operation
mininet-wifi copied to clipboard

CLI command via script

Open andredemori opened this issue 1 year ago • 6 comments

Is there any way to run a command in the CLI per line of code?

I need to run the following command:

mininet-wifi> sh ifconfig hwsim0 up

but i need to run it via script and not via terminal. Is there a way to include this command in my code?

andredemori avatar Oct 24 '23 18:10 andredemori

You can run that command from any node running at root ns.

node.cmd('command')

ramonfontes avatar Oct 24 '23 18:10 ramonfontes

I tried, but in Wireshark, when I select hwsim0 it says the device is still down. Only works via CLI.

andredemori avatar Oct 24 '23 18:10 andredemori

Did you bring the interface up??

ramonfontes avatar Oct 24 '23 18:10 ramonfontes

i'm trying to do it in the code, but only works via CLI

sta1.cmd('sh ifconfig hwsim0 up') --> not works

mininet-wifi> sh ifconfig hwsim0 up --> works

I don't know if there is a way to run this command in the code. only via CLI. Do you know a way?

andredemori avatar Oct 24 '23 18:10 andredemori

Is sta1 running at root NS?? And why are you using sh??

ramonfontes avatar Oct 24 '23 19:10 ramonfontes

sorry. I don't know how to run sta1 at root NS.

I run with sh because it not works without sh

mininet-wifi> ifconfig hwsim0 up *** Unknown command: ifconfig hwsim0 up

Thanks in advance.

andredemori avatar Oct 24 '23 19:10 andredemori