PHPackages                             dylandreimerink/gobgp-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dylandreimerink/gobgp-php

ActiveLibrary

dylandreimerink/gobgp-php
=========================

118PHP

Since Nov 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dylandreimerink/gobgp-php)[ Packagist](https://packagist.org/packages/dylandreimerink/gobgp-php)[ RSS](/packages/dylandreimerink-gobgp-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

GoBGP-PHP
=========

[](#gobgp-php)

A PHP wrapper for the [GoBGP](https://github.com/osrg/gobgp) gRPC client

Requirements
------------

[](#requirements)

- PHP 7
- The gRPC PHP extension:

Installation
------------

[](#installation)

1. Install the gRPC PHP extension by following these [installation instructions](https://grpc.io/docs/quickstart/php.html#prerequisites)
2. require the package: `composer require dylandreimerink/gobgp-php`

Goals
-----

[](#goals)

This project was made for 2 main reasons:

1. If you wanted to use the GoBGP API you would have to manually generate the gRPC client code for PHP, which is a pain.
2. Once you have the GoBGP API it is hard to get started because most data that is sent from and to the GoBGP API is encoded and is not well documented.

The goal of this project is to solve both of these issue's. Even tho I might decide to move the pregenerated client code to a separate repo and package.

As of this moment only a small part of the GoBGP API is wrapped, but I hope to get full coverage as soon as passable. After that is done the whole code base should receive unit tests.

Help and contributions are always welcome

Guide for contributes
---------------------

[](#guide-for-contributes)

### Generating GoBGP gRPC API client code

[](#generating-gobgp-grpc-api-client-code)

The client code is generated from the [.proto file](https://github.com/osrg/gobgp/blob/master/api/gobgp.proto) at /api/gobgp.proto This file is in the [protocol buffers](https://developers.google.com/protocol-buffers/) format, gRPC uses protocol buffers as format for sending the API calls. Therefor we need to install protoc(The protocol buffers compiler) and compile the gRPC php plugin for protoc

Step by step:

1. Follow the normal installation instructions first
2. Install protoc by following the [installation instructions](https://github.com/google/protobuf/tree/master/src/README.md) for your system
3. Install the gRPC PHP protoc plugin by following the [instructions](https://grpc.io/docs/quickstart/php.html#install-protobuf-plugin)
4. Get the latest .proto file from GoBGP, [generate](https://grpc.io/docs/quickstart/php.html#generate-grpc-code) the latest client code and replace the code in /lib with the newly generated client code

The current version of the client code was generated from the .proto file in commit [\#3678607](https://github.com/osrg/gobgp/commit/36786073c1301b3ee63ff27ea7733613fd31626c)

### Docs and references

[](#docs-and-references)

Most of the work is in decoding and encoding to the correct formats. Most of the formats are from accepted BGP RFC's or draft's. Up until now I used the following docs to find what I need:

- Base BGP FlowSpec RFC -
- IPv6 extension of RFC5575 -
- L2VPN extension of RFC5575 -
- BGP-4 RFC -
- List of BGP attributes -

Sometimes GoBGP can differ a bit from the latest draft's, in those cases you have to reverse engineer the format or look at the source code.

TODO's
------

[](#todos)

- Wrap all API calls
- Write unit tests for all encoding and decoding functions
- Add rule builders to further simplify the usage of the library
- Make a easy method of querying and filtering routes

Idea's / use cases
------------------

[](#ideas--use-cases)

- Use 2 GoBGP servers with a php-gobgp instance in the middle so more advanced input filtering can be done than is currently possible in BGP itself
- Make route synchronization between multiple route servers so the sake of redundancy
- Make a version of this library for symfony and laravel
- Making a auto backup system using the MRT dumps and injection functionality of GoBGP
- Making custom monitoring for changes in BGP announcements

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

---

Top Contributors

[![dylandreimerink](https://avatars.githubusercontent.com/u/1799415?v=4)](https://github.com/dylandreimerink "dylandreimerink (10 commits)")

### Embed Badge

![Health badge](/badges/dylandreimerink-gobgp-php/health.svg)

```
[![Health](https://phpackages.com/badges/dylandreimerink-gobgp-php/health.svg)](https://phpackages.com/packages/dylandreimerink-gobgp-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
