Apache License 2.0

项目介绍

opiproject/opi-evpn-bridge 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 Apache License 2.0 许可证,目前获得 18 个 Star、20 次 Fork。

仓库全名
opiproject/opi-evpn-bridge
开源许可证
Apache License 2.0
Star 数
18
Fork 数
20
未关闭 Issue
44

README 摘要

OPI gRPC to EVPN GW FRR bridge This repo includes OPI reference code for EVPN Gateway based on FRR. The specification for these APIs can be found here. I Want To Contribute This project welcomes contributions and suggestions. We are happy to have the Community involved via submission of Issues and Pull Requests (with substantive content or even just fixes). We are hoping for the documents, test framework, etc. to…

完整内容见 GitHub 原始 README 或本页 。

常见问题

opi-evpn-bridge 用什么语言开发?

主要使用 Go 编写,采用 Apache License 2.0 许可证,目前有 18 个 Star。

opi-evpn-bridge 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 opi-evpn-bridge 的源码?

可以直接克隆仓库:git clone https://github.com/opiproject/opi-evpn-bridge.git,默认分支为 main;安装与运行步骤见仓库 README。

opi-evpn-bridge 最近还在维护吗?

仓库最近一次更新为 2025年3月7日,当前有 44 个未关闭 Issue;Star 数为 18,可作为社区活跃度的参考。

关于

OPI gRPC to EVPN GW FRR bridge

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
59
价值分
14
活跃状态
活跃

语言占比

Dockerfile
Go
Makefile

Release

README

OPI gRPC to EVPN GW FRR bridge

Linters CodeQL OpenSSF Scorecard tests Docker License codecov Go Report Card Go Doc Pulls Last Release GitHub stars GitHub Contributors

This repo includes OPI reference code for EVPN Gateway based on FRR. The specification for these APIs can be found here.

I Want To Contribute

This project welcomes contributions and suggestions. We are happy to have the Community involved via submission of Issues and Pull Requests (with substantive content or even just fixes). We are hoping for the documents, test framework, etc. to become a community process with active engagement. PRs can be reviewed by by any number of people, and a maintainer may accept.

See CONTRIBUTING and GitHub Basic Process for more details.

Getting started

:exclamation: docker-compose is deprecated. For details, see Migrate to Compose V2.

Run docker-compose up -d or docker compose up -d

Manual gRPC example

using grpcurl

# create
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"vrf" : {"spec" : {"vni" : 1234, "loopback_ip_prefix" : {"addr": {"af": "IP_AF_INET", "v4_addr": 167772162} }, "len": 24}, "vtep_ip_prefix": {"addr": {"af": "IP_AF_INET", "v4_addr": 167772162} }, "len": 24} }}, "vrf_id" : "testvrf" }' localhost:50151 opi_api.network.evpn_gw.v1alpha1.VrfService.CreateVrf"
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"logical_bridge" : {"spec" : {"vni": 10, "vlan_id": 10 } }, "logical_bridge_id" : "testbridge" }' localhost:50151 opi_api.network.evpn_gw.v1alpha1.LogicalBridgeService.CreateLogicalBridge
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"bridge_port" : {"spec" : {mac_address: "qrvMAAAB", "ptype": "BRIDGE_PORT_TYPE_ACCESS", "logical_bridges": ["//network.opiproject.org/bridges/testbridge"] }}, "bridge_port_id" : "testport"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.BridgePortService.CreateBridgePort
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"svi" : {"spec" : {"vrf": "//network.opiproject.org/vrfs/testvrf", "logical_bridge": "//network.opiproject.org/bridges/testbridge", mac_address: "qrvMAAAB", "gw_ip_prefix": [{"addr": {"af": "IP_AF_INET", "v4_addr": 167772162} }, "len": 24}] } }, "svi_id" : "testsvi" }' localhost:50151 opi_api.network.evpn_gw.v1alpha1.SviService.CreateSvi
# get
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name": "//network.opiproject.org/ports/testinterface"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.BridgePortService.GetBridgePort
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name": "//network.opiproject.org/bridges/testbridge"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.LogicalBridgeService.GetLogicalBridge
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name": "//network.opiproject.org/svis/testsvi"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.SviService.GetSvi
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name": "//network.opiproject.org/vrfs/testvrf"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.VrfService.GetVrf
#list
docker-compose exec opi-evpn-bridge grpcurl -plaintext localhost:50151 opi_api.network.evpn_gw.v1alpha1.BridgePortService.ListBridgePorts
docker-compose exec opi-evpn-bridge grpcurl -plaintext localhost:50151 opi_api.network.evpn_gw.v1alpha1.BridgePortService.ListLogicalBridges
docker-compose exec opi-evpn-bridge grpcurl -plaintext localhost:50151 opi_api.network.evpn_gw.v1alpha1.BridgePortService.ListSvis
docker-compose exec opi-evpn-bridge grpcurl -plaintext localhost:50151 opi_api.network.evpn_gw.v1alpha1.BridgePortService.ListVrfs
# delete
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name": "//network.opiproject.org/ports/testinterface"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.BridgePortService.DeleteBridgePort
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name": "//network.opiproject.org/bridges/testbridge"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.LogicalBridgeService.DeleteLogicalBridge
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name" : "//network.opiproject.org/svis/testsvi"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.SviService.DeleteSvi
docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name" : "//network.opiproject.org/vrfs/testvrf"}' localhost:50151 opi_api.network.evpn_gw.v1alpha1.VrfService.DeleteVrf

using grpc_cli

$ docker run --rm -it --network=container:opi-evpn-bridge-opi-evpn-bridge-1 docker.io/namely/grpc-cli ls localhost:50151
grpc.reflection.v1.ServerReflection
grpc.reflection.v1alpha.ServerReflection
opi_api.network.evpn_gw.v1alpha1.BridgePortService
opi_api.network.evpn_gw.v1alpha1.LogicalBridgeService
opi_api.network.evpn_gw.v1alpha1.SviService
opi_api.network.evpn_gw.v1alpha1.VrfService

$ docker run --rm -it --network=container:opi-evpn-bridge-opi-evpn-bridge-1 docker.io/namely/grpc-cli call localhost:50151 VrfService.ListVrfs ""
connecting to localhost:50151
...
Rpc succeeded with OK status

using godpu

$ docker run --rm -it --network=host docker.io/opiproject/godpu:main evpn --help
Tests DPU evpn functionality

Usage:
  godpu evpn [flags]
  godpu evpn [command]

Aliases:
  evpn, g

Available Commands:
  create-bp   Create a bridge port
  create-lb   Create a logical bridge
  create-svi  Create a SVI
  create-vrf  Create a VRF
  delete-bp   Delete a bridge port
  delete-lb   Delete a logical bridge
  delete-svi  Delete a SVI
  delete-vrf  Delete a VRF
  get-bp      Show details of a bridge port
  get-lb      Show details of a logical bridge
  get-svi     Show details of a SVI
  get-vrf     Show details of a VRF
  list-bps    Show details of all bridge ports
  list-lbs    Show details of all logical bridges
  list-svis   Show details of all SVIs
  list-vrfs   Show details of all Vrfs
  update-bp   Update the bridge port
  update-lb   update the logical bridge
  update-svi  update the SVI
  update-vrf  update the VRF

Flags:
  -h, --help   help for evpn

Use "godpu evpn [command] --help" for more information about a command.

Manual HTTP example

In addition HTTP is supported via grpc gateway, for example:

curl -kL http://10.10.10.10:8082/v1/inventory/1/inventory/2

Architecture Diagram

OPI EVPN Bridge Architcture Diagram

Tests

Test your APIs even if unmerged using your private fork like this:

chmod a+w go.*
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod edit -replace github.com/opiproject/opi-api@main=github.com/YOURUSERNAME/opi-api@main
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go get -u github.com/YOURUSERNAME/opi-api/network/evpn-gw/v1alpha1/gen/go@0e2810d
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod tidy

Generate mocks like this:

go install github.com/vektra/mockery/v2@latest
make mock-generate

# or using docker
docker run -v "$PWD":/src -w /src vektra/mockery --config=utils/mocks/.mockery.yaml --name=Netlink --dir pkg/utils --output pkg/utils/mocks --boilerplate-file pkg/utils/mocks/boilerplate.txt --with-expecter

POC diagrams

OPI EVPN Bridge POC Diagram for CI/CD OPI EVPN Bridge Diagram for L2VXLAN OPI EVPN Bridge Diagram for L3VXLAN Asymmetric IRB OPI EVPN Bridge Diagram for L3VXLAN Symmetric IRB OPI EVPN Bridge Diagram for L2VXLAN in_Symmetric IRB OPI EVPN Bridge Diagram for Leaf1_Detailed_View

评论

暂无评论