mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
27b80a935b
Receiving
=========
Extended communities sent from FRR side:
```
route-map lb permit 10
set extcommunity bandwidth 10
set extcommunity soo 65001:123
exit
```
On GoBGP side it's decoded as 125000 as IEEE floating-point.
```
% sudo ./gobgp global rib 192.168.100.1/32 --json | jq '."192.168.100.1/32"'
[
{
"nlri": {
"prefix": "192.168.100.1/32"
},
"age": 1632128843,
"best": true,
"attrs": [
{
"type": 1,
"value": 2
},
{
"type": 2,
"as_paths": [
{
"segment_type": 2,
"num": 1,
"asns": [
65534
]
}
]
},
{
"type": 3,
"nexthop": "192.168.10.123"
},
{
"type": 4,
"metric": 0
},
{
"type": 16,
"value": [
{
"type": 64,
"subtype": 4,
"asn": 65534,
"bandwidth": 1250000
},
{
"type": 0,
"subtype": 3,
"value": "65001:123"
}
]
}
],
"stale": false,
"source-id": "192.168.100.2",
"neighbor-ip": "192.168.10.123"
}
]
```
Sending
=======
When sending from GoBGP side:
```
[[policy-definitions]]
name = "policy1"
[[policy-definitions.statements]]
[policy-definitions.statements.actions.bgp-actions.set-ext-community]
options = "replace"
[policy-definitions.statements.actions.bgp-actions.set-ext-community.set-ext-community-method]
communities-list = ["lb:65021:125000"]
```
We get properly encoded/decoded in FRR as well:
```
~# vtysh -c 'show ip bgp 10.33.0.0/16 json' | grep 'LB:'
"string":"RT:300:400 SoO:100:200 LB:65021:125000 (1.000 Mbps)"
```
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>