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
h2 ifconfig h2-eth0
py "Current network:"
py "Adding switches to the controller"
sh ovs-vsctl set-controller s1 tcp:
sh ovs-vsctl set-controller s2 tcp:

Enjoy it!


Popular posts from this blog

from: can't read /var/mail/ in Python scripts

How to fix Android when developer options are not available for this user

How to install a WhatsApp bot based on Python