linux - Initializing a Mininet topology from a bash script -


i'd automate process of setting mininet virtual machine, sshing vm, starting mininet within vm, , initializing topology. need session remain open can issue commands mininet using created network. works, including initializing network, once bash script ends, mininet tears down topology , exits virtual machine. relevant parts of code follows:

vboxmanage startvm "mininet-vm_1" --type=headless  ssh -t -y -l mininet -p 2222 localhost << herpderp      # start network     sudo mn --controller=remote,ip=$ip --custom /home/mininet/sf_mininet_vm/mininet/topo_basic.py --topo clos_tree --switch ovsk --link tc  herpderp 

things i've tried:

  1. ending here document s0 bash;
  2. ending s0 $shell;
  3. removing delimiter @ end of here document (shot in dark).

(1) , (2) exited mininet , left me prompt in vm, reason can't issue commands it. (3) nothing.

if have python topo in file can run topo using

sudo -e python <nameofthefile> 

for example, if have topo in file pkt_topo_with_loop.py, use sudo -e python pkt_topo_with_loop.py start mininet. have line in bash script automation.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -