第一步:上传安装包
省略
第二步: 安装服务
yum install unzip telnet java-1.8.0-openjdk net-tools -y
yum install mininet-2.2.2-2.el7.x86_64.rpm openvswitch-2.5.0-2.el7.x86_64.rpm python-networkx-1.8.1-12.el7.noarch.rpm python-networkx-core-1.8.1-12.el7.noarch.rpm -y
启动ovs
systemctl start openvswitch
第三步:配置karaf
unzip distribution-karaf-0.6.0-Carbon.zip
cd distribution-karaf-0.6.0-Carbon/bin/
./start
./client ##这里需要等待一下在输入
第四步: 安装组件
opendaylight-user@root>feature:install odl-restconf odl-l2switch-switch-ui odl-mdsal-apidocs odl-dluxapps-applications
在浏览器打开 http://ip:8181/index.html
第五步:搭建拓扑
opendaylight-user@root>logout
mn --controller=remote,ip=127.0.0.1,port=6653 --topo=tree,1,3
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2 h3
h2 -> h1 h3
h3 -> h1 h2
*** Results: 0% dropped (6/6 received)
mininet>
第六步: 下发流表
mininet> dpctl add-flow in_port=1,actions=output:3
*** s1 ------------------------------------------------------------------------
mininet> dpctl add-flow in_port=3,actions=output:1
*** s1 ------------------------------------------------------------------------
mininet> pingall
*** Ping: testing ping reachability
h1 -> X h3
h2 -> X X
h3 -> h1 X
*** Results: 66% dropped (2/6 received)
mininet>
第七步:启动http-server功能
mininet> h1 python -m SimpleHTTPServer 8080 &
mininet> sh apt install wget -y
mininet> h3 wget 10.0.0.1:8080
--2022-07-20 12:52:56-- http://10.0.0.1:8080/
Connecting to 10.0.0.1:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1052 (1.0K) [text/html]
Saving to: ‘index.html’
index.html 100%[===================>] 1.03K --.-KB/s in 0s
2022-07-20 12:52:56 (123 MB/s) - ‘index.html’ saved [1052/1052]
mininet>