The reason i've written this script is because the sudo mn --topo tree,node,leafnode command takes a lifetime and core dumps most of the time.
Install Mininet by following the instructions at :
https://github.com/mininet/mininet
Once installed run the topogen script as follows:
-
sudo python topogen.py <no-of-switches> <no-of-hosts>
-
Example: sudo python topogen.py 4 16 creates a datacenter topology with 4+ switches and 16 hosts.
The diagram below shows the type of topology being generated:
Clone the Pox Repo from the following address:
-https://github.com/noxrepo/pox
Run the topogen_remote.py script with the same syntax as above
- Here each node gets assigned a mac address in the follwing form:
- If node number a<100 : MAC:: 00:00:00:00:00:01.........00:00:00:00:00:99
- If node number a>=100: MAC: 00:00:00:00:01:00.........00:00:00:00:09:99
- If node number a<100 : MAC:: 00:00:00:00:00:01.........00:00:00:00:00:99
Use the following tutorial to create the firewall script:
The firewall.py script provided in the repo adds few random firewall rules. Feel free to edit it as per your liking.
Always controller c[0] is used as remote controller since it takes all connections.
Run the scripts as per the tutorial and now you have a network setup with a working firewall :)