安装OpenDaylight及Openflow插件
1. 安装 Java 和 Maven
CentOS7:
yum install java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 maven -y
环境变量:
# /etc/profile
...
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-1.el7_7.x86_64
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
Ubuntu16.04:
sudo apt update
sudo apt install openjdk-8-jdk-headless maven
echo JAVA_HOME=export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 >> ~/.bashrc
source ~/.bashrc mvn -v
2. 安装 OpenDaylight
~$ wget https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.6.4-Carbon/distribution-karaf-0.6.4-Carbon.zip
~$ unzip distribution-karaf-0.6.4-Carbon.zip
~$ cd distribution-karaf-0.6.4-Carbon
修改配置:
# etc/org.apache.karaf.management.cfg
rmiRegistryHost = 127.0.0.1
rmiServerHost = 127.0.0.1
附:修改 Openflow controller 连接端口(因为SDN控制器默认的连接端口指定为6653和6633,如果在一个系统中需要使用多种SDN控制器的情况下,那么就会出现端口占用无法连接控制器的情况。)
如无冲突,则不需修改。
# etc/opendaylight/datastore/initial/config/default-openflow-connection-config.xml
# etc/opendaylight/datastore/initial/config/legacy-openflow-connection-config.xml
<switch-connection-config xmlns="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:config">
<instance-name>openflow-switch-connection-provider-default-impl</instance-name>
<port>6653</port>
...
启动、安装插件:
~/distribution-karaf-0.6.4-Carbon$ cd bin
~/distribution-karaf-0.6.4-Carbon/bin$ export TERM=xterm-color #(ubuntu18需要,ubuntu16不需要)
~/distribution-karaf-0.6.4-Carbon/bin$ ./karaf
opendaylight-user@root>feature:install odl-openflowplugin-flow-services-rest odl-openflowplugin-app-table-miss-enforcer odl-openflowplugin-nxm-extensions odl-restconf odl-l2switch-switch-ui odl-openflowplugin-flow-services-ui odl-mdsal-apidocs odl-dluxapps-applications odl-faas-all
3. 安装Openflowplugin — 开发者使用
用于搭建 Openflowplugin 开发环境。(如无需求,可不安装)
~$ git clone https://github.com/opendaylight/openflowplugin.git
~$ cd openflowplugin/
~/openflowplugin$ git tag
~/openflowplugin$ git checkout release/carbon
~/openflowplugin$ git branch
~/openflowplugin$ mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true
~/openflowplugin$ cd distribution/karaf/target/assembly/bin
~/openflowplugin/distribution/karaf/target/assembly/bin$ ./karaf
opendaylight-user@root>feature:install odl-restconf odl-dlux-core
4. 安装 mininet
~$ sudo apt install net-tools -y
~$ git clone git://github.com/mininet/mininet
~$ cd mininet/
~/mininet$ git tag
~/mininet$ git checkout 2.3.0d6
~/mininet$ cd util
~/mininet/util$ sudo ./install.sh
启动:
~$ sudo mn
5. 使用例子
5.1 mininet 自定义拓扑
# ~/mn-test/topo1.py
from mininet.topo import Topo class MyTopo(Topo):
def __init__(self):
Topo.__init__(self) host1 = self.addHost('h1')
host2 = self.addHost('h2')
switch1 = self.addSwitch('s1')
switch2 = self.addSwitch('s2') self.addLink(host1, switch1)
self.addLink(host2, switch2)
self.addLink(switch1, switch2) topos = {
'mytopo': lambda: MyTopo()
}
5.2 连接 ODL controller
~$ sudo mn --custom mn-test/topo1.py --topo mytopo --controller=remote,ip=192.168.1.7,port=6633 --switch ovsk,protocols=OpenFlow13
登录 ODL web 界面,查看 topology,此时只能够看到 switchs。
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2
h2 -> h1
*** Results: 0% dropped (2/2 received)
再次查看,此时能够看到 hosts。
5.3 例子
ps:使用 Postman 测试(关闭防火墙或开放8181端口)。
basic auth: admin:admin
查看节点(GET):http://192.168.1.7:8181/restconf/operational/opendaylight-inventory:nodes/
查看拓扑(GET):http://192.168.1.7:8181/restconf/operational/network-topology:network-topology/
查看端口(GET):/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:2
查看流表(GET):/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/
参考资料
https://docs.opendaylight.org/en/latest/getting-started-guide/installing_opendaylight.html
https://blog.csdn.net/weixin_40610952/article/details/80378784
安装OpenDaylight及Openflow插件的更多相关文章
- 安装Visual Studio的插件AnkhSvn
安装Visual Studio的插件AnkhSvn 安装AnkhSvn(VS插件).下载地址:http://download.csdn.net/detail/luqingfei/4538807 Ank ...
- 安装Sublime Text 3插件的方法
直接安装 安装Sublime text 3插件很方便,可以直接下载安装包解压缩到Packages目录(菜单->preferences->packages). 使用Package Contr ...
- 安装VS2010水晶报表插件
Visual Studio 2010默认不带水晶报表,需要安装一个水晶报表插件,首先下载此插件: http://downloads.businessobjects.com/akdlm/cr4vs201 ...
- 【原】安装mongo的php插件
http://pecl.php.net/package/mongo https://github.com/mongodb/mongo-php-driver/tarball/master 1. 安装mo ...
- 安装GO语言环境之安装Visual Studio Code插件
在安装Visual Studio Code插件的时候,由于谷歌的限制,在下载下列插件的时候会报错: go get -u -v github.com/nsf/gocode go get -u -v gi ...
- Eclipse如何安装JD-Eclipse反编译插件
一.Eclipse在线安装JD-Eclipse反编译插件 1.在eclipse的help—>Install New Software...中添加新软件开发,添加它的源: name:jd-ecli ...
- 安装Sublime Text 2插件的方法
1.直接安装 安装Sublime text 2插件很方便,可以直接下载安装包解压缩到Packages目录(菜单->preferences->packages). 2.使用Package C ...
- myeclipse和eclipse安装Java反编译插件
为myeclipse和eclipse安装Java反编译插件 插件所需包 1.解压jad1.5.8g.zip.将jad.exe放到jre的bin目录下,下载地址: http://ishare.ia ...
- [原]Eclipse 安装SVN、Maven插件(补充)
参考雨之殇的文章:Eclipse 安装SVN.Maven插件 1.SVN可以按文章介绍的正常安装 2.Maven的Eclipse插件地址有变化 文章中的安装链接已经失效:m2e - http://m2 ...
随机推荐
- 详解Python Google Protocol Buffer
为什么要使用PB? PB(Protocol Buffer)是 Google 开发的用于结构化数据交换格式,作为腾讯云日志服务标准写入格式.因此用于写入日志数据前,需要将日志原始数据序列化为 PB 数据 ...
- iOS 自定义tabBarController(中间弧形)
效果图 1.在继承自UITabBarController的自定义controller中调用以下方法(LZCustomTabbar为自定义的tabbar) - (void)viewDidAppear:( ...
- ASP.NET Core 中间件 自定义全局异常中间件以及 MVC异常过滤器作用
中间件是一种装配到应用管道以处理请求和响应的软件. 每个组件: 选择是否将请求传递到管道中的下一个组件. 可在管道中的下一个组件前后执行工作. 请求委托用于生成请求管道. 请求委托处理每个 HTTP ...
- jQuery中live()使用报错,TypeError: $(...).live is not a function
原博文 https://blog.csdn.net/sdfdyubo/article/details/59536781 使用 原写法 /*为选项卡绑定右键*/ $(".tabs li&quo ...
- .net mvc 微信公众号 验证微信签名
官方文档:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421135319&token=&lang=zh_CN ...
- Argo CD使用指南:如何构建一套完整的GitOps?
随着Kubernetes继续将自己确立为容器编排的行业标准,为你的应用和工具找到使用声明式模型的有效方法是成功的关键.在这篇文章中,我们将在AWS中建立一个K3s Kubernetes集群,然后使用A ...
- Demo分享丨看ModelArts与HiLens是如何让车自己跑起来的
摘要:基于HiLens Kit已经基本开发完成,可部署到HiLens Kit,模型的选择为基于DarkNet53的YOLOv3模型,权重为基于COCO2014训练的数据集,而车道线的检测是基于Open ...
- 网易163 docker镜像
$ sudo echo "DOCKER_OPTS=\"--registry-mirror=http://hub-mirror.c.163.com\"" > ...
- Kubernetes K8S之通过helm部署metrics-server与HPA详解
Kubernetes K8S之通过helm部署metrics-server与 Horizontal Pod Autoscaling (HPA)详解 主机配置规划 服务器名称(hostname) 系统版 ...
- Redis 设计与实现 9:五大数据类型之集合
集合对象的编码有两种:intset 和 hashtable 编码一:intset intset 的结构 整数集合 intset 是集合底层的实现之一,从名字就可以看出,这是专门为整数提供的集合类型. ...