Add Physical Interfaces into mininet switch

untuk menambahkan physical interface kedalam mininet switch, dapat menggunakan script dibawah ini :

#!/usr/bin/python

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

def myNetwork():
    net = Mininet( topo=None,controller=RemoteController,switch=OVSSwitch)

    info( '*** Add Controller\n')
    net.addController('c0', ip='127.0.0.1', port=6633)

    info( '*** Add switches\n')
    s1 = net.addSwitch('s1')
    Intf( 'ens4', node=s1 )

    info( '*** Add hosts\n')
    h1 = net.addHost('h1', ip='10.0.0.1')

    info( '*** Add links\n')
    net.addLink(h1, s1)

    info( '*** Starting network\n')
    net.start()
    CLI(net)
    net.stop()

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

Script tersebut menambahkan interface ens4 kedalam s1 didalam mininet.

Comments are closed.