This document defines a function called myNetwork() that is used to create a virtual network topology in Mininet. The function adds controllers, switches, routers and hosts to the network and configures the IP addresses and links between them. It then builds the network, starts the controllers and switches, and provides a command line interface to interact with the virtual network before stopping it.
This document defines a function called myNetwork() that is used to create a virtual network topology in Mininet. The function adds controllers, switches, routers and hosts to the network and configures the IP addresses and links between them. It then builds the network, starts the controllers and switches, and provides a command line interface to interact with the virtual network before stopping it.
This document defines a function called myNetwork() that is used to create a virtual network topology in Mininet. The function adds controllers, switches, routers and hosts to the network and configures the IP addresses and links between them. It then builds the network, starts the controllers and switches, and provides a command line interface to interact with the virtual network before stopping it.
from mininet.node import Controller, RemoteController, OVSController from mininet.node import Host, Node from mininet.node import OVSKernelSwitch, UserSwitch from mininet.node import IVSSwitch from mininet.cli import CLI from mininet.log import setLogLevel, info from mininet.link import TCLink, Intf from subprocess import call
r3.cmd('ip route add 10.0.2.0/24 via 192.168.1.2 dev r3-eth1')
r3.cmd('ip route add 192.168.1.4/30 via 192.168.1.2 dev r3-eth1')
r4.cmd('ip route add 10.0.2.0/24 via 192.168.1.6 dev r4-eth1')
r4.cmd('ip route add 10.0.1.0/24 via 192.168.1.1 dev r4-eth0') r5.cmd('ip route add 10.0.1.0/24 via 192.168.1.5 dev r5-eth1') r5.cmd('ip route add 192.168.1.0/30 via 192.168.1.5 dev r5-eth1')
info( '*** Starting network\n')
net.build()
info( '*** Starting controllers\n')
for controller in net.controllers: controller.start()