GithubHelp home page GithubHelp logo

ops-gobgp's Introduction

Ops-GoBGP

Ops-GoBGP relaying OpenSwitch and GoBGP. Specifically, you can relay the bgp settings to gobgp that you set in the console of OpenSwitch, and can relay the route that has GoBGP to OpenSwitch.

This page explains how to run Ops-GoBGP. This example have to relay settings and routes between OpenSwitch and Gobgp using Ops-GoBGP in docker container.

Prerequisites

Install the docker environment referring to the here.

Running OpenSwitch container

  • Pull image
$ sudo docker pull osrg/openswitch
$ sudo docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
osrg/openswitch   latest              6509d58db7f5        2 hours ago         1.338 GB
  • Run container
sudo docker run --privileged -v /tmp:/tmp -v /dev/log:/dev/log -v /sys/fs/cgroup:/sys/fs/cgroup -h ops --name ops osrg/openswitch /sbin/init &
$ sudo docker ps -a
CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS              PORTS               NAMES
452f31c31be6        osrg/openswitch   "/sbin/init"        4 seconds ago       Up 2 seconds                            ops
$ sudo docker exec -it ops bash

Installing GoBGP

  • Preparation
 bash-4.3# echo "nameserver 8.8.8.8" >> /etc/resolv.conf
  • Install GoBGP
 bash-4.3# go get -v github.com/osrg/gobgp/gobgpd
 bash-4.3# go get -v github.com/osrg/gobgp/gobgp

Installing Ops-GoBGP

  • Clone source
 bash-4.3# git clone https://github.com/osrg/ops-gobgp.git
  • Install dependent libraries of python
 bash-4.3# cd ops-gobgp
 bash-4.3# pip install -r pip-requires.txt

Starting relay using the Ops-GoBGP

  • Setting OpenSwitch
bash-4.3# vtysh
switch# show running-config
Current configuration:
!
!
!
switch# configure terminal
switch(config)# router bgp 65001
switch(config-router)# bgp router-id 10.0.255.1
switch(config-router)# neighbor 10.0.255.2 remote-as 65002
switch(config-router)# do show running-config
Current configuration:
!
!
!
router bgp 65001
    bgp router-id 10.0.255.1
    neighbor 10.0.255.2 remote-as 65002
!
  • Starting GoBGP
bash-4.3# gobgpd -p --openswitch
INFO[0000] gobgpd started
INFO[0000] Read Configuration from OpenSwitch
  • Starting Ops-GoBGP
bash-4.3# cd ~/ops-gobgp
bash-4.3# python openswitch.py
2016-01-06 20:49:36,412 - connection - INFO - Connecting to OpenSwitch...
2016-01-06 20:49:36,618 - connection - INFO - Connected
2016-01-06 20:49:36,639 - connection - INFO - Connecting to Gobgp...
2016-01-06 20:49:36,640 - connection - INFO - Connected
2016-01-06 20:49:36,641 - connection - INFO - Run run_ops_to_gogbp thread...
2016-01-06 20:49:36,642 - connection - INFO - Run run_gogbp_to_ops thread...
2016-01-06 20:49:36,644 - connection - INFO - Wait for a change the bestpath from gobgp...

If GoBGP has routes in Global Rib, routes relayed to the OpenSwitch as follows:

bash-4.3# vtysh
switch# show ip bgp
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

Local router-id 10.0.255.1
   Network          Next Hop            Metric LocPrf Weight Path
*  10.10.10.0/24    10.0.255.2            0      0  32768 65002 i
*  10.10.11.0/24    10.0.255.2            0      0  32768 65002 i
*  10.10.12.0/24    10.0.255.2            0      0  32768 65002 i
Total number of entries 3

Licensing

Ops-GoBGP is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

ops-gobgp's People

Contributors

h-naoto avatar fujita avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.