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:
- ending here document
s0 bash
; - ending
s0 $shell
; - 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
Post a Comment