This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Yet Another Border Gateway Protocol Python Implementation

Project Description

What is yabgp?

YABGP is a yet another Python implementation for BGP Protocol. It can be used to establish BGP connections with all kinds of routers (include real Cisco/HuaWei/Juniper routers and some router simulators like GNS3) and receive/parse BGP messages for future analysis.

Support sending BGP messages(route refresh/update) to the peer through RESTful API. YABGP can’t send any BGP update messages by itself, it’s just a agent, so there can be many agents and they can be controlled by a contoller.

We write it in strict accordance with the specifications of RFCs.

This software can be used on Linux/Unix, Mac OS and Windows systems.


  • It can establish BGP session based on IPv4 address (TCP Layer) in active mode(as TCP client);
  • Support TCP MD5 authentication(IPv4 and does not support Windows now);
  • BGP capabilities support: 4 Bytes ASN, Route Refresh(Cisco Route Refresh), Add Path send/receive;
  • Address family support:
    • IPv4/IPv6 unicast
    • IPv4/IPv6 Labeled Unicast
    • IPv4 Flowspec(limited)
    • IPv4/IPv6 MPLSVPN
    • EVPN (partially supported)
  • Decode all BGP messages to json format and write them into files in local disk(configurable);
  • Support basic RESTFUL API for getting running information and sending BGP messages.

Quick Start

We recommend run yabgp through python virtual-env from source code or pip install

Use yabgp from source code:

$ virtualenv yabgp-virl
$ source yabgp-virl/bin/activate
$ git clone
$ cd yabgp
$ pip install -r requirements.txt
$ cd bin
$ python yabgpd -h

Use pip install

$ virtualenv yabgp-virl
$ source yabgp-virl/bin/activate
$ pip install yabgp
$ which yabgpd
$ yabgpd -h

For example:

$ yabgpd --bgp-local_addr= --bgp-local_as=65001 --bgp-remote_addr= --bgp-remote_as=65001 --bgp-md5=test --config-file=../etc/yabgp/yabgp.ini

BGP message example:

in yabgp.ini, you can point out if you want to store the parsing BGP message to local disk and where you want to put them in.


More information please see the documentation


Please join our Slack for questions, discussion, suggestions, etc

Send email to, or use GitHub issue system.


Please create Github Pull Request

More details please read HACKING.rst.


For core files like fsm, protocol, we copy some of the code from,

and message parsing, we reference from

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
yabgp-0.2.8.tar.gz (111.3 kB) Copy SHA256 Checksum SHA256 Source Jul 3, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting