You are on page 1of 3

=> Obtenha permissões de super usuário

$ su
password: (openflow)

=> Faça update e instale os pacotes requeridos

# apt update
# apt upgrade
# apt install openssl ca-certificates python-openssl pyca python3-openssl libssl-dev \
build-essential checkinstall libreadline6-dev libncursesw5-dev \
tk-dev libgdbm-dev libc6-dev libbz2-dev zlib1g-dev libsqlite3-dev \
libncurses5-dev xz-utils tk-dev \
libreadline-dev wget curl llvm git screen \
liblzma-dev liblzma5 lzma lzma-dev python-lzma \

=> Realize o download do Python 3.6

# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz

=> Instalando o Python 3.6


tar xzf Python-3.6.1.tgz
cd Python-3.6.1
./configure --enable-optimizations
make -j8

vi Makefile

=> Altere a linha para:


CC= gcc -pthread -fprofile-arcs -ftest-coverage -lgcov --coverage

=> Salve e saia do arquivo (ESC + : + w + q)

# make altinstall
# python3.6

=> você deve ver a cli do python ativa com sucesso

=> Crie seu ambiente de desenvolvimento


# python3.6 -m venv test42
# source test42/bin/activate

(teste42)# pip install --upgrade pip


=> Clonando os principais repositórios
(teste42)# for project in python-openflow kytos-utils kytos; do
git clone https://github.com/kytos/$project.git
done

=> Instalando projetos no seu ambiente de desenvolvimento


(teste42)# for project in python-openflow kytos-utils kytos; do
cd $project
pip install -e .[dev]
python setup.py develop || break
cd -
done

=> Inicie o kytos em background


(teste42)# kytosd -f &

=> Faça o download dos Napps


(teste42)# kytos napps install kytos/of_core \
kytos/of_flow_manager \
kytos/of_ipv6drop \
kytos/of_l2ls \
kytos/of_lldp \
kytos/of_topology \
kytos/web_topology_layout

(teste42)# kytos napps install legacy/of_core \


legacy/of_flow_manager \
legacy/of_ipv6drop \
legacy/of_l2ls \
legacy/of_lldp \
legacy/of_topology \
legacy/web_topology_layout

=> Desabilite os Napps


(teste42)# kytos napps disable all

(teste42)# mkdir ~/tutorials


(teste42)# kytos napps create

=>
Please, insert your NApps Server username: tutorial
Please, insert your NApp name: of_l3ls
Please, insert a brief description for your NApp [optional]: This NApp does packet switching
using L3 information

(teste42)# cd tutorial/tutorial/of_l3ls
(teste42)# vi main.py (ou qualquer outro editor)

=> após editar o arquivo, abra uma sessão screen


(teste42)# screen

=> aperte space


- CTRL+a c - cria nova screen
- CTRL+a d - fecha screen
- CTRL+SPACE ou CTRL+BACKSPACE - navega entre as screens

[screen 1]# source test42/bin/activate


[screen 1](teste42)# kytosd -f

[screen 2]# source test42/bin/activate


[screen 2](teste42)# kytos napps list
[screen 2](teste42)# kytos napps enable kytos/of_core

=> Na pasta ~/tutorials


[screen 2](teste42)# kytos napps install tutorial/of_l3ls
[screen 2](teste42)# vi tutorial/of_l3ls/kytos.json

=> Edite a linha


"version": "0.1.0",

You might also like