diff options
Diffstat (limited to 'docs/sources')
-rw-r--r-- | docs/sources/evpn.md | 308 |
1 files changed, 205 insertions, 103 deletions
diff --git a/docs/sources/evpn.md b/docs/sources/evpn.md index 0b6d49b8..a5d287ae 100644 --- a/docs/sources/evpn.md +++ b/docs/sources/evpn.md @@ -192,185 +192,287 @@ ipv4/flow-vpn,*: - ## YABGP -Just like the last example, this example uses [YABGP](https://github.com/smartbgp/yabgp). GoBGP receives -routes from one YABGP peer and advertises it to another YABGP peer. +Just like the example using BaGPipe, this example uses [YABGP](https://github.com/smartbgp/yabgp). +GoBGP receives EVPN routes from one YABGP peer and re-advertises it to another YABGP peer. + +**NOTE:** The following supposes to use YABGP version "0.3.1". ### Configuration -Gobgp configuration: +YABGP supports eBGP peering. The following example shows GoBGP and two YABGP peers are connected +with eBGP and GoBGP interchanges EVPN routes from one YABGP peer to another. + +Topology: + +``` + +------------+ + | GoBGP | + +-----| AS 65254 |-----+ + | | 10.0.0.254 | | + | +------------+ | + | | + (eBGP) (eBGP) + | | ++----------+ +----------+ +| YABGP | | YABGP | +| AS 65001 | | AS 65002 | +| 10.0.0.1 | | 10.0.0.2 | ++----------+ +----------+ +``` + +GoBGP on "10.0.0.254": `gobgpd.toml` ```toml [global.config] -as = 100 -router-id = "192.168.1.2" -local-address-list = ["10.79.45.72"] + as = 65254 + router-id = "10.0.0.254" [[neighbors]] -[neighbors.config] -neighbor-address = "10.75.44.10" -peer-as = 300 -[[neighbors.afi-safis]] -[neighbors.afi-safis.config] -afi-safi-name = "l2vpn-evpn" -[neighbors.transport.config] -local-address = "10.79.45.72" -[neighbors.ebgp-multihop.config] -enabled = true + [neighbors.config] + neighbor-address = "10.0.0.1" + peer-as = 65001 + [[neighbors.afi-safis]] + [neighbors.afi-safis.config] + afi-safi-name = "l2vpn-evpn" [[neighbors]] -[neighbors.config] -neighbor-address = "10.75.44.11" -peer-as = 200 -[[neighbors.afi-safis]] -[neighbors.afi-safis.config] -afi-safi-name = "l2vpn-evpn" -[neighbors.transport.config] -local-address = "10.79.45.72" -[neighbors.ebgp-multihop.config] -enabled = true + [neighbors.config] + neighbor-address = "10.0.0.2" + peer-as = 65002 + [[neighbors.afi-safis]] + [neighbors.afi-safis.config] + afi-safi-name = "l2vpn-evpn" ``` -`10.75.44.10` and `10.75.44.11` is the address of YABGP peers. We start two YABGP agents like this: +You can start YABGP with the following CLI options: ```bash -python yabgp/bin/yabgpd --bgp-local_as=300 --bgp-remote_addr=10.79.45.72 --bgp-remote_as=100 --bgp-local_addr=10.75.44.10 --bgp-afi_safi=evpn -``` -``` bash -python yabgp/bin/yabgpd --bgp-local_as=200 --bgp-remote_addr=10.79.45.72 --bgp-remote_as=100 --bgp-local_addr=10.75.44.11 --bgp-afi_safi=evpn +# YABGP peer on "10.0.0.1" +$ yabgpd --bgp-local_as=65001 --bgp-local_addr=10.0.0.1 --bgp-remote_addr=10.0.0.254 --bgp-remote_as=65254 --bgp-afi_safi=evpn + +# YABGP peer on "10.0.0.2" +$ yabgpd --bgp-local_as=65002 --bgp-local_addr=10.0.0.2 --bgp-remote_addr=10.0.0.254 --bgp-remote_as=65254 --bgp-afi_safi=evpn ``` -From gobgp CMD: +Then, you can see GoBGP can connect to two YABGP peers by using gobgp command: ``` bash +# GoBGP +$ gobgpd -f gobgpd.toml +...(snip)... + $ gobgp neighbor -Peer AS Up/Down State |#Advertised Received Accepted -10.75.44.10 300 00:01:23 Establ | 0 0 0 -10.75.44.11 200 00:02:26 Establ | 0 0 0 +Peer AS Up/Down State |#Received Accepted +10.0.0.1 65001 hh:mm:ss Establ | 0 0 +10.0.0.2 65002 hh:mm:ss Establ | 0 0 ``` ### Advertising EVPN route -We can advertise EVPN routes from YABGP 10.75.44.11 through its REST API, -the `Authorization` header is `admin/admin`, and the `Content-Type` is `application/json`. +We can advertise EVPN routes from YABGP 10.0.0.1 through its [REST +API](http://yabgp.readthedocs.io/en/latest/restapi.html). +In the REST request, you need to specify the `Authorization` header is `admin/admin`, and the +`Content-Type` is `application/json`. -``` bash -POST http://10.75.44.11:8801/v1/peer/10.79.45.72/send/update -``` +Request URL for sending UPDATE messages: +``` +POST http://10.0.0.1:8801/v1/peer/10.0.0.254/send/update +``` -We will run this API four times, each time's POST data is: +We will run this API four times to advertise four EVPN route types. +The following example use "curl" command for sending POST request. EVPN type 1: -``` json -{ - "attr":{ - "1": 0, - "2": [], - "5": 100, +```bash +curl -X POST -u admin:admin -H 'Content-Type: application/json' http://10.0.0.1:8801/v1/peer/10.0.0.254/send/update -d '{ + "attr": { + "1": 0, + "2": [], + "5": 100, "14": { - "afi_safi": [25, 70], + "afi_safi": [ + 25, + 70 + ], "nexthop": "10.75.44.254", - "nlri": [{ - "type": 1, - "value": { - "rd": "1.1.1.1:32867", - "esi": 0, - "eth_tag_id": 100, - "label": [10] + "nlri": [ + { + "type": 1, + "value": { + "esi": 0, + "eth_tag_id": 100, + "label": [ + 10 + ], + "rd": "1.1.1.1:32867" + } } - }]}, - "16":[[1537, 0, 500]] -}} + ] + }, + "16": [ + [ + 1537, + 0, + 500 + ] + ] + } +}' ``` EVPN type 2: -``` json -{ - "attr":{ - "1": 0, - "2": [], - "5": 100, +```bash +curl -X POST -u admin:admin -H 'Content-Type: application/json' http://10.0.0.1:8801/v1/peer/10.0.0.254/send/update -d '{ + "attr": { + "1": 0, + "2": [], + "5": 100, "14": { - "afi_safi": [25, 70], + "afi_safi": [ + 25, + 70 + ], "nexthop": "10.75.44.254", "nlri": [ { "type": 2, "value": { + "esi": 0, "eth_tag_id": 108, "ip": "11.11.11.1", - "label": [0], - "rd": "172.17.0.3:2", + "label": [ + 0 + ], "mac": "00-11-22-33-44-55", - "esi": 0}}]}, - "16":[[1536, 1, 500]] -}} + "rd": "172.17.0.3:2" + } + } + ] + }, + "16": [ + [ + 1536, + 1, + 500 + ] + ] + } +}' ``` EVPN type 3: -``` json -{ - "attr":{ - "1": 0, - "2": [], - "5": 100, +```bash +curl -X POST -u admin:admin -H 'Content-Type: application/json' http://10.0.0.1:8801/v1/peer/10.0.0.254/send/update -d '{ + "attr": { + "1": 0, + "2": [], + "5": 100, "14": { - "afi_safi": [25, 70], + "afi_safi": [ + 25, + 70 + ], "nexthop": "10.75.44.254", "nlri": [ { "type": 3, "value": { - "rd": "172.16.0.1:5904", "eth_tag_id": 100, - "ip": "192.168.0.1" + "ip": "192.168.0.1", + "rd": "172.16.0.1:5904" } } ] } -}} + } +}' ``` EVPN type 4: -``` json -{ - "attr":{ - "1": 0, - "2": [], - "5": 100, +```bash +curl -X POST -u admin:admin -H 'Content-Type: application/json' http://10.0.0.1:8801/v1/peer/10.0.0.254/send/update -d '{ + "attr": { + "1": 0, + "2": [], + "5": 100, "14": { - "afi_safi": [25, 70], + "afi_safi": [ + 25, + 70 + ], "nexthop": "10.75.44.254", "nlri": [ { "type": 4, "value": { - "rd": "172.16.0.1:8888", "esi": 0, - "ip": "192.168.0.1" + "ip": "192.168.0.1", + "rd": "172.16.0.1:8888" } } ] }, - "16":[[1538, "00-11-22-33-44-55"]] -}} + "16": [ + [ + 1538, + "00-11-22-33-44-55" + ] + ] + } +}' ``` -GoBGP will received these four routes and readvertise them to peer 10.75.44.10 -``` bash -$ gobgp monitor adj-in -[ROUTE] [type:A-D][rd:1.1.1.1:32867][esi:single-homed][etag:100][label:161] via 10.75.44.254 aspath [] attrs [{Extcomms: [esi-label: 8001]} {Origin: i} {LocalPref: 100}] -[ROUTE] [type:macadv][rd:172.17.0.3:2][esi:single-homed][etag:108][mac:00:11:22:33:44:55][ip:11.11.11.1][labels:[0]] via 10.75.44.254 aspath [] attrs [{Extcomms: [mac-mobility: 500, sticky]} {Origin: i} {LocalPref: 100}] -[ROUTE] [type:multicast][rd:172.16.0.1:5904][etag:100][ip:192.168.0.1] via 10.75.44.254 aspath [] attrs [{Origin: i} {LocalPref: 100}] -[ROUTE] [type:esi][rd:172.16.0.1:8888][esi:{0 [0 0 0 0 0 0 0 0 0]}][ip:192.168.0.1] via 10.75.44.254 aspath [] attrs [{Extcomms: [es-import rt: 00:11:22:33:44:55]} {Origin: i} {LocalPref: 100}] +GoBGP will receive these four routes and re-advertise them to YABGP peer on "10.0.0.2" + +```bash +# GoBGP +$ gobgp global rib -a evpn + Network Labels Next Hop AS_PATH Age Attrs +*> [type:A-D][rd:1.1.1.1:32867][esi:single-homed][etag:100] [161] 10.75.44.254 hh:mm:ss [{Extcomms: [esi-label: 8001]} {Origin: i} {LocalPref: 100}] +*> [type:esi][rd:172.16.0.1:8888][esi:{0 [0 0 0 0 0 0 0 0 0]}][ip:192.168.0.1] 10.75.44.254 hh:mm:ss [{Extcomms: [es-import rt: 00:11:22:33:44:55]} {Origin: i} {LocalPref: 100}] +*> [type:macadv][rd:172.17.0.3:2][etag:108][mac:00:11:22:33:44:55][ip:11.11.11.1] [0] 10.75.44.254 hh:mm:ss [{Extcomms: [mac-mobility: 500, sticky]} {Origin: i} {LocalPref: 100} [ESI: single-homed]] +*> [type:multicast][rd:172.16.0.1:5904][etag:100][ip:192.168.0.1] 10.75.44.254 hh:mm:ss [{Origin: i} {LocalPref: 100}] ``` -``` bash -$ gobgp neighbor -Peer AS Up/Down State |#Advertised Received Accepted -10.75.44.10 300 00:21:00 Establ | 4 0 0 -10.75.44.11 200 00:22:03 Establ | 0 4 4 +Then, check statistics of neighbors for confirming the number of re-advertised routes. + +```bash +# GoBGP +$ gobgp neighbor +Peer AS Up/Down State |#Received Accepted +10.0.0.1 65001 hh:mm:ss Establ | 4 4 +10.0.0.2 65002 hh:mm:ss Establ | 0 0 + +$ gobgp neighbor 10.0.0.2 +BGP neighbor is 10.0.0.2, remote AS 65002 + BGP version 4, remote router ID 10.0.0.2 + BGP state = established, up for hh:mm:ss + BGP OutQ = 0, Flops = 0 + Hold time is 90, keepalive interval is 30 seconds + Configured hold time is 90, keepalive interval is 30 seconds + + Neighbor capabilities: + multiprotocol: + l2vpn-evpn: advertised and received + route-refresh: advertised and received + 4-octet-as: advertised and received + enhanced-route-refresh: received + cisco-route-refresh: received + Message statistics: + Sent Rcvd + Opens: 2 2 + Notifications: 0 0 + Updates: 4 0 + Keepalives: 2 2 + Route Refresh: 0 0 + Discarded: 0 0 + Total: 8 4 + Route statistics: + Advertised: 4 + Received: 0 + Accepted: 0 ``` |