首先,這是我的python 程式碼:
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
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
s3 = self.addSwitch( 's3' )
s4 = self.addSwitch( 's4' )
h1 = self.addHost( 'h1' )
h2 = self.addHost( 'h2' )
# Add links
self.addLink(s1,s2)
self.addLink(s2,s3)
self.addLink(s3,s4)
self.addLink(s4,s1)
self.addLink(s1,h1)
self.addLink(s3,h2)
topos = { 'mytopo': ( lambda: MyTopo() ) }
然後,我使用了2個終端機去執行這個程式:
第一個終端機是輸入:
ryu-manager ryu.app.simple_switch_13

第二個終端機是輸入:
sudo ./MiniNAM --custom topo.py --topo mytopo --controller remote

這是我的MiniNAM介面

當我要使用 CLI `pingall`它沒辦法成功ping

接著,我也輸入了 xtrem h1 打開 h1 的終端機
我輸入了ping -c 4 10.0.0.2,但2台主機互不相通

所以,我用了google搜尋相關資訊。然後找到這個網站:
https://ting-kuan.blog/2018/04/04/%E3%80%90sdn-switch-flow-table-%E8%A8%AD%E5%AE%9A-%E4%BD%BF%E7%94%A8mininam-%E3%80%91/
當我使用他們的方法解決時,遇上一些問題,像我輸入了這個指令,則遇上Warning 的問題
curl -X POST -d '{"dpid":"0000000000000004","priority":"100","actions":[{"type":"OUTPUT","port":2}],"match":{"in_port":1}}' http://127.0.0.1:6653/status/flowentry/add
系統給了這些Warning
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: " to save to a file.

我不知道這問題要怎麼解決,希望你們可以幫到我