Automate mininet to run batch commands
If you prefer to use mininet console instead python API, maybe you will need automate the process to run batch commands.
With source command you can load a file with all commands to execute inside mininet, like this:
source init.cli
This is the content of init.cli:
py "Configuring network"
h1 ifconfig h1-eth0 10.0.1.1/24
h2 ifconfig h2-eth0 10.0.1.2/24
py "Current network:"
net
dump
py "Adding switches to the controller"
sh ovs-vsctl set-controller s1 tcp:127.0.0.1:6633
sh ovs-vsctl set-controller s2 tcp:127.0.0.1:6633
Enjoy it!
With source command you can load a file with all commands to execute inside mininet, like this:
source init.cli
This is the content of init.cli:
py "Configuring network"
h1 ifconfig h1-eth0 10.0.1.1/24
h2 ifconfig h2-eth0 10.0.1.2/24
py "Current network:"
net
dump
py "Adding switches to the controller"
sh ovs-vsctl set-controller s1 tcp:127.0.0.1:6633
sh ovs-vsctl set-controller s2 tcp:127.0.0.1:6633
Enjoy it!
Comments
Post a Comment