我刚刚设置了mininet拓扑 . 但是现在我想通过ubuntu中的接口将mininet中的一个端口连接到外部端口 . Ubuntu服务器有两个端口:ens33连接到真实网络,ens38连接到VMnet2 . 我的python脚本如下:


from mininet.net import Mininet
from mininet.node import Controller
from mininet.cli import CLI
from mininet.link import Intf
from mininet.log import setLogLevel, info

from mininet.topo import Topo

class MyTopo( Topo ):
"Simple topology example."

def __init__( self ):
    "Create custom topo."

    # Initialize topology
    Topo.__init__( self )

    # Add hosts and switches
    '*** Add switches\n'
    s1 = self.addSwitch('s1')
    Intf( 'ens38', node=s1 )

    s2 = self.addSwitch('s2')

    '*** Add hosts\n'
    h2 = self.addHost( 'h2' )
    # Add links
    '*** Add links\n'
    self.addLink(h2, s2)

topos = { 'mytopo': ( lambda: MyTopo() ) }

但是当我使用commnad行运行时:mn --custom qtho-topo.py --topo mytopo --controller = remote,ip = 192.168.1.128,port = 6633 --switch ovsk,protocols = OpenFlow13 . 有错误:


抓到了异常 . 打扫干净...

AttributeError:'str'对象没有属性'addIntf'

任何人都有关于此的exp . 请帮我!!!