I'm trying to run a Mininet session on a virtualbox with Ubuntu 16.04.7 and I was successfully able to deploy a dhcp server within the session. Unfortunately, when I try to run the 'dhclient' command on any of the hosts created in the Mininet session, the command line just hangs. The dhcp server is waiting to send out leases but the hosts never send the request. Something that I have noticed that may be pertinent is that each virtual host within the Mininet session seems to refer back to the Ubuntu virtualbox machine's '/etc/network/interfaces' file. Meaning that if I modify the 'interfaces' file from a host in the network simulation then it in turn modifies the 'interfaces' on the Ubuntu virtualbox host. Please keep in mind that I'm new to both Ubuntu and Mininet just a few weeks experience. Please see code below, note I still issue a lot of commands from within the simulated session.
#!/usr/bin/python
"""Custom topology example
Router1----Switch1
Switch1-----Host1
Switch1-----Host2
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.node import OVSSwitch, Controller, RemoteController
class SingleSwitchTopo(Topo):
"Single Router connected to Two Switches"
def build(self):
s1 = self.addSwitch('s1')
s2 = self.addSwitch('s2')
r1 = self.addHost('r1', mac="00:00:00:00:01:01")
h1 = self.addHost('h1')
h2 = self.addHost('h2')
self.addLink(h1, s1)
self.addLink(h2, s2)
self.addLink(s1, r1)
self.addLink(s2, r1)
topos = { 'mytopo': ( lambda: SingleSwitchTopo() ) }
if __name__ == '__main__':
setLogLevel('info')
topo = SingleSwitchTopo()
c1 = RemoteController('c1', ip='127.0.0.1')
net = Mininet(topo=topo, controller=c1)
net.start()
#net.pingAll()
CLI(net)
net.stop()