Skip to content

Commit

Permalink
doc: Document for Peer Group and Dynamic Neighbor
Browse files Browse the repository at this point in the history
Signed-off-by: Satoshi Fujimoto <[email protected]>
  • Loading branch information
fujimoto-s authored and fujita committed Nov 1, 2017
1 parent c18a89f commit 6f88f35
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 0 deletions.
89 changes: 89 additions & 0 deletions docs/sources/dynamic-neighbor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Dynamic Neighbor

This page explains how to configure the Dynamic Neighbor features.
Dynamic Neighbor enables GoBGP to accept connections from the peers in specific prefix.

## Contents

- [Prerequisite](#prerequisite)
- [Configuration](#configuration)
- [Verification](#verification)

## Prerequisite
Assumed that you finished [Getting Started](getting-started.md) and learned [Peer Group](peer-group.md).

## Configuration

The Dynamic Neighbor feature requires a peer group setting for its configuration.

```toml
[global.config]
as = 65001
router-id = "172.40.1.2"

[[peer-groups]]
[peer-groups.config]
peer-group-name = "sample-group"
peer-as = 65002
[[peer-groups.afi-safis]]
[peer-groups.afi-safis.config]
afi-safi-name = "ipv4-unicast"
[[peer-groups.afi-safis]]
[peer-groups.afi-safis.config]
afi-safi-name = "ipv4-flowspec"

[[dynamic-neighbors]]
[dynamic-neighbors.config]
prefix = "172.40.0.0/16"
peer-group = "sample-group"
```

By this configuration, peers in `172.40.0.0/16` will be accepted by this GoBGP,
and the `sample-group` configuration is used as the configuration of members of this dynamic neighbor.

Note that GoBGP will be passive mode to members of dynamic neighbors.
So if both peers listen to each other as dynamic neighbors, the connection will never be established.

# Verification

Dynamic neighbors are not shown by `gobgp neighbor` command until the connection is established.
```shell
$ gobgp neighbor
Peer AS Up/Down State |#Received Accepted
```

After the connection is established, the neighbor will appear by `gobgp neighbor` command.
You can see the neighbor config is inherited from the peer group config.

```shell
$ gobgp neighbor
Peer AS Up/Down State |#Received Accepted
172.40.1.3 65001 00:00:23 Establ | 0 0
$ gobgp neighbor 172.40.1.3
BGP neighbor is 172.40.1.3, remote AS 65002
BGP version 4, remote router ID 172.40.1.3
BGP state = established, up for 00:00:07
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:
ipv4-unicast: advertised and received
ipv4-flowspec: advertised and received
route-refresh: advertised and received
4-octet-as: advertised and received
Message statistics:
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 0 0
Keepalives: 1 1
Route Refresh: 0 0
Discarded: 0 0
Total: 2 2
Route statistics:
Advertised: 0
Received: 0
Accepted: 0
```
81 changes: 81 additions & 0 deletions docs/sources/peer-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Peer Group

This page explains how to configure the Peer Group features.
With Peer Group, you can set the same configuration to multiple peers.

## Contents

- [Prerequisite](#prerequisite)
- [Configuration](#configuration)
- [Verification](#verification)

## Prerequisite
Assumed that you finished [Getting Started](getting-started.md).

## Configuration

Below is the configuration to create a peer group.

```toml
[[peer-groups]]
[peer-groups.config]
peer-group-name = "sample-group"
peer-as = 65001
[[peer-groups.afi-safis]]
[peer-groups.afi-safis.config]
afi-safi-name = "ipv4-unicast"
[[peer-groups.afi-safis]]
[peer-groups.afi-safis.config]
afi-safi-name = "ipv4-flowspec"
```

The configurations in this peer group will be inherited to the neighbors which is the member of this peer group.
In addition, you can add additional configurations to each member.

Below is the configuration to create a neighbor which belongs this peer group.

```toml
[[neighbors]]
[neighbors.config]
neighbor-address = "172.40.1.3"
peer-group = "sample-group"
[neighbors.timers.config]
hold-time = 99
```

This neighbor belongs to the peer group, so the peer-as is 65001, and ipv4-unicast and ipv4-flowspec are enabled.
Furthermore, an additional configuration is set, the hold timer is 99 secs.

## Verification

You can see the neighbor configuration inherits the peer group config by running `gobgp neighbor` command.

```shell
$ gobgp neighbor 172.40.1.3
BGP neighbor is 172.40.1.3, remote AS 65001
BGP version 4, remote router ID 172.40.1.3
BGP state = established, up for 00:00:05
BGP OutQ = 0, Flops = 0
Hold time is 99, keepalive interval is 33 seconds
Configured hold time is 99, keepalive interval is 33 seconds

Neighbor capabilities:
multiprotocol:
ipv4-unicast: advertised and received
ipv4-flowspec: advertised and received
route-refresh: advertised and received
4-octet-as: advertised and received
Message statistics:
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 0 0
Keepalives: 1 1
Route Refresh: 0 0
Discarded: 0 0
Total: 2 2
Route statistics:
Advertised: 0
Received: 0
Accepted: 0
```

0 comments on commit 6f88f35

Please sign in to comment.