作业博客链接:http://edu.cnblogs.com/campus/fzu/fzusdn2019/homework/10017
1. 解压安装OpenDayLight控制器(本次实验统一使用Beryllium版本)
- OpenDayLight是java实现的,因此需要先[配置java环境]
- 然后下载JDK安装包解压
- 配置相应的环境变量
- 在终端输入java -version 检查java环境是否配置成功
2. 启动并安装插件
进入文件地址 /distribution-karaf-0.4.4-Beryllium-SR4/bin
打开终端执行命令 ./karaf
安装插件Features执行命令
opendaylight-user@root>feature:install odl-restconf
opendaylight-user@root>feature:install odl-l2switch-switch-ui
opendaylight-user@root>feature:install odl-openflowplugin-all
opendaylight-user@root>feature:install odl-mdsal-apidocs
opendaylight-user@root>feature:install odl-dlux-core
opendaylight-user@root>feature:install odl-dlux-node
opendaylight-user@root>feature:install odl-dlux-yangui
3. 用Python脚本搭建如下拓扑,连接OpenDayLight控制器
- Python脚本如下
from mininet.topo import Topo
class Mytopo(Topo):
def __init__(self):
Topo.__init__(self)
sw=self.addSwitch('s1')
count=1
for i in range(3):
host = self.addHost('h{}'.format(count))
self.addLink(host,sw,1,count)
count = count + 1
topos = {'mytopo': (lambda:Mytopo())}
- 运行脚本,并检查拓扑连接状况
执行命令sudo mn --custom /home/joker/桌面/mytopo.py --topo mytopo --controller=remote,ip=127.0.0.1,port=6633 --switch ovsk,protocols=OpenFlow13
然后pingall
在ODl打开的情况下登陆网站http://localhost:8181/index.html
输入账号 admin
输入密码 admin
Reload检查拓扑连接状况