Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[mininet-discuss] Using setARP() with setMAC() && setIP()

Jason jason_edelman at
Mon Apr 28 18:39:25 PDT 2014

I'm looking to statically configure IP and MAC on host interfaces and then set static ARP entries on each host. 
Have tried multiple variations of using h.setIP(), h.setMAC(), and setARP(), but manual ARP entries will not work after manually setting the MAC on the interface.  I've tried h.cmd() as well to config ARP entries.  If I only configure a static IP (with default MAC), the ARP entries work fine...clearly, that is unacceptable though :).  After adding the static IP+MAC, the ARP entries no longer work...have also tried placing net.start() in different locations to see if that dice there.

Been at this for hours, so any help would be greatly appreciated :)

I've taken a look at this and doesn't seem to be helping:

Code here showing various things with some commented out as well...
if __name__ == '__main__':    setLogLevel( 'info' )    topo = MyTopo()    net = Mininet(topo=topo, switch=UserSwitch, controller=RemoteController)    #net.start()    h1, h2, h3 = net.hosts    hosts = [h1,h2,h3]    ip_mac = {'':'00:00:00:00:00:10','':'00:00:00:00:00:11','':'00:00:00:00:00:12'}    c=10
    net.start()    for h in hosts:      ip, mac = "10.0.0."+str(c), "00:00:00:00:00:"+str(c)      #h.setIP("10.0.0."+str(c)+"/24")      #h.setMAC("00:00:00:00:00:"+str(c))      h.setIP(ip+"/24")      h.setMAC(mac)      h.setARP('', "00:00:00:00:00:02")      '''      for cip in ip_mac.keys():         if not cip == ip:          h.setARP(cip,ip_mac[cip])          print cip + ' ' + ip_mac[cip]      '''       c+=1        CLI(net)    #h2.setARP('', "00:00:00:00:00:02")    #h2.cmd('arp -i h1-eth0 -s 00:00:00:00:00:12')            net.stop()

-----------Topo detail/class:from mininet.topo import Topofrom mininet.cli import CLIfrom mininet.log import setLogLevelfrom mininet.node import UserSwitch, RemoteControllerfrom mininet.topolib import TreeNetfrom mininet.topo import SingleSwitchTopofrom import Mininet
class MyTopo( Topo ):    "Simple topology example."
    def __init__( self ):        "Create custom topo."
        # Initialize topology        Topo.__init__( self )
        # Add hosts and switches        leftHost1 = self.addHost( 'h1',ip="")        leftHost2 = self.addHost( 'h2' )        rightHost = self.addHost( 'h3' )        leftSwitch = self.addSwitch( 's3' )        rightSwitch = self.addSwitch( 's4' )
        # Add links        self.addLink( leftHost1, leftSwitch )        self.addLink( leftHost2, leftSwitch )        self.addLink( leftSwitch, rightSwitch )        self.addLink( rightSwitch, rightHost ) 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the mininet-discuss mailing list