Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Error creating interface pair (s2-eth5,s3-eth1): RTNETLINK answers: File exists #737

Closed
AlPazinou opened this issue Apr 28, 2017 · 12 comments

Comments

@AlPazinou
Copy link

Hi,
I'm using mininet I created a topology using miniedit and generated a script (minitopo.py)
and i'm getting this error when executing the script

Traceback (most recent call last):
  File "minitopo1.py", line 70, in <module>
    myNetwork()
  File "minitopo1.py", line 49, in myNetwork
    net.addLink(s2, s3)
  File "/home/mininet/mininet/mininet/net.py", line 364, in addLink
    link = cls( node1, node2, **options )
  File "/home/mininet/mininet/mininet/link.py", line 424, in __init__
    node1, node2, deleteIntfs=False )
  File "/home/mininet/mininet/mininet/link.py", line 468, in makeIntfPair
    deleteIntfs=deleteIntfs )
  File "/home/mininet/mininet/mininet/util.py", line 194, in makeIntfPair
    ( intf1, intf2, cmdOutput ) )
Exception: Error creating interface pair (s2-eth5,s3-eth1): RTNETLINK answers: File exists

I've tried to use it without the remote controller, and had the same problem , there's something wrong in creating the links between (s2,s3) and (s4,s3)

here's the script (minitopo.py) ,

#!/usr/bin/python

from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, 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

def myNetwork():

    net = Mininet( topo=None,
                   build=False,
                   ipBase='10.0.0.0/8')

    info( '*** Adding controller\n' )
    c1=net.addController(name='c1',
                      controller=Controller,
                      protocol='tcp',
                      port=6633)

    info( '*** Add switches\n')
    s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
    s4 = net.addSwitch('s4', cls=OVSKernelSwitch)
    s3 = net.addSwitch('s3', cls=OVSKernelSwitch)

    info( '*** Add hosts\n')
    h7 = net.addHost('h7', cls=Host, ip='10.0.0.7', defaultRoute=None)
    h2 = net.addHost('h2', cls=Host, ip='10.0.0.2', defaultRoute=None)
    h3 = net.addHost('h3', cls=Host, ip='10.0.0.3', defaultRoute=None)
    h4 = net.addHost('h4', cls=Host, ip='10.0.0.4', defaultRoute=None)
    h6 = net.addHost('h6', cls=Host, ip='10.0.0.6', defaultRoute=None)
    h5 = net.addHost('h5', cls=Host, ip='10.0.0.5', defaultRoute=None)
    h8 = net.addHost('h8', cls=Host, ip='10.0.0.8', defaultRoute=None)
    h1 = net.addHost('h1', cls=Host, ip='10.0.0.1', defaultRoute=None)

    info( '*** Add links\n')
    net.addLink(s2, h4)
    net.addLink(s2, h3)
    net.addLink(s2, h2)
    net.addLink(s2, h1)
    net.addLink(s4, h5)
    net.addLink(s4, h6)
    net.addLink(s4, h7)
    net.addLink(s4, h8)
    net.addLink(s2, s3)
    net.addLink(s3, s4)

    info( '*** Starting network\n')
    net.build()
    info( '*** Starting controllers\n')
    for controller in net.controllers:
        controller.start()

    info( '*** Starting switches\n')
    net.get('s2').start([])
    net.get('s4').start([])
    net.get('s3').start([c1])

    info( '*** Post configure switches and hosts\n')

    CLI(net)
    net.stop()

if __name__ == '__main__':
    setLogLevel( 'info' )
    myNetwork()

could you please telle me what's wrong ?

@hwchiu
Copy link
Contributor

hwchiu commented Apr 28, 2017

Can you use "sudo mn -c" to clean your env and try again ?

@AlPazinou
Copy link
Author

AlPazinou commented Apr 28, 2017 via email

@AlPazinou
Copy link
Author

AlPazinou commented Apr 29, 2017 via email

@AlPazinou
Copy link
Author

AlPazinou commented Apr 29, 2017 via email

@lantz
Copy link
Member

lantz commented May 30, 2017

Not a Mininet error, as noted above.

@lantz lantz closed this as completed May 30, 2017
@mishi-a
Copy link

mishi-a commented Mar 21, 2018

Remove the Previous topology by using sudo mn -c

@hahazyb201
Copy link

The solution by Ayush-IITP above works.

@moeinarab
Copy link

Can you use "sudo mn -c" to clean your env and try again ?

This command worked for me.

@Haritha2298
Copy link

when i execute the make command to compile the source_routing. p4 file, it says the following

mkdir -p build pcaps logs
p4c-bm2-ss --p4v 16 --p4runtime-files build/source_routing.p4.p4info.txt -o build/source_routing.json source_routing.p4
sudo python ../utils/run_exercise.py -t topology.json -j build/source_routing.json -b simple_switch_grpc
Reading topology file.
Building mininet topology.
Traceback (most recent call last):
File "../utils/run_exercise.py", line 397, in
exercise.run_exercise()
File "../utils/run_exercise.py", line 202, in run_exercise
self.create_network()
File "../utils/run_exercise.py", line 267, in create_network
controller=None)
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 174, in init
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 502, in build
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 489, in buildFromTopo
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 400, in addLink
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 557, in init
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 451, in init
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 496, in makeIntfPair
File "build/bdist.linux-x86_64/egg/mininet/util.py", line 267, in makeIntfPair
Exception: Error creating interface pair (s1-eth2,s2-eth2): RTNETLINK answers: File exists

../utils/Makefile:35: recipe for target 'run' failed
make: *** [run] Error 1

Could someone please tell how to resolve it?

@Jhemme1991
Copy link

Hola buenas, alguien puede ayudarme en otro error ?

@LukasChenChen
Copy link

when i execute the make command to compile the source_routing. p4 file, it says the following

mkdir -p build pcaps logs
p4c-bm2-ss --p4v 16 --p4runtime-files build/source_routing.p4.p4info.txt -o build/source_routing.json source_routing.p4
sudo python ../utils/run_exercise.py -t topology.json -j build/source_routing.json -b simple_switch_grpc
Reading topology file.
Building mininet topology.
Traceback (most recent call last):
File "../utils/run_exercise.py", line 397, in
exercise.run_exercise()
File "../utils/run_exercise.py", line 202, in run_exercise
self.create_network()
File "../utils/run_exercise.py", line 267, in create_network
controller=None)
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 174, in init
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 502, in build
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 489, in buildFromTopo
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 400, in addLink
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 557, in init
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 451, in init
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 496, in makeIntfPair
File "build/bdist.linux-x86_64/egg/mininet/util.py", line 267, in makeIntfPair
Exception: Error creating interface pair (s1-eth2,s2-eth2): RTNETLINK answers: File exists

../utils/Makefile:35: recipe for target 'run' failed
make: *** [run] Error 1

Could someone please tell how to resolve it?

Did you solve this ?

@RedhwanGhailan
Copy link

RedhwanGhailan commented Apr 11, 2021

As @hwchiu said if the issue related to the existing files then all what you need is to clean the old files that were generated since the last run. So the command <sudo mn -c> is enough!
But if the problem still up so you have to edit your file and make the required changes like, change the path of your output, ect.

For edit any file visit the links below:
https://github.com/RedhwanGhailan/HOW-TOs/blob/main/How%20to%20edit%20a%20file%20inside%20a%20mininet%20VM
https://www.youtube.com/watch?v=LzSOmqbBOa4&list=PLGBaJmn0Gd4e2sMdVQ3alC-wDDXZemDOc&index=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants