当前位置: 首页 > 工具软件 > ONOS > 使用案例 >

ONOS安装和运行

韩恺
2023-12-01

安装运行ONOS

1.安装Karaf,Maraf

http://archive.apache.org/dist/karaf/3.0.3/apache-karaf-3.0.3.tar.gz
http://archive.apache.org/dist/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz

2.安装install Oracle Java 8

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default -y

3.获取ONOS

git clone https://gerrit.onosproject.org/onos

另外可从github下载源码,下载地址

https://github.com/opennetworkinglab/onos

其他操作

$ cd onos

$ git checkout master # checks out 'master' as the working branch

$ git pull --rebase origin master # pulls the latest code from Gerrit, and rebases any local changes onto origin/master


$ cd onos

$ git checkout 1.1.0# checks out the official release tag

$ git checkout onos-1.1 # checks out the Blackbird maintenance branch

4.设置环境

export ONOS_ROOT=/home/fan/onos-1.3.0
export KARAF_ROOT=/home/fan/tar/apache-karaf-3.0.3/
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export M2_HOME=/home/fan/tar/apache-maven-3.3.1/
export PATH=$PATH:$M2_HOME/bin


source /etc/profile

source $ONOS_ROOT/tools/dev/bash_profile

查看java版本

java –version
mvn –version

5.构建和打包ONOS

构建

$ cd ~/onos-1.3.0    
$ mvn clean install

打包

op

-rw-r--r--  1 tom  wheel  101196349 Apr 30 14:39 /tmp/onos-1.2.0.user.tar.gz

-rw-r--r--  1 tom  wheel  101763602 Apr 30 14:39 /tmp/onos-1.2.0.user.zip

6.本地运行ONOS

$ export ONOS_IP=192.168.222.131
$ export ONOS_APPS=drivers,openflow,proxyarp,mobility,fwd
$ ok clean

At this point, typing help onos at the prompt should still bring up a list of available commands. Pressing Ctrl-D or logout will exit the CLI.

查看特定端口进程:sudo lsof -i :6633

7.mininet连接控制器

sudo mn --topo=tree,2,2 --controller=remote,ip=192.168.222.131,port=6633
sudo mn --custom ~/mytopo21.py --topo=mytopo --ontroller=remote,ip=10.109.247.218,port=6633

8.GUI

与ONOS交互有3种方式:CLI,GUI,REST API

地址:http://localhost:8181/onos/ui

默认用户名密码:karaf

来源

https://wiki.onosproject.org/display/ONOS13/Wiki+Home

 类似资料: