# BGP Confederation

This page explains how to configure BGP confederation feature when BGP peers
are part of a larger mesh representing a single autonomous system (AS).

## Prerequisites

Assume you finished [Getting Started](getting-started.md).

## Contents

- [Configuration](#configuration)

## Configuration

If AS30 is a confederation composed of AS65001 and AS65002, the confederation members must configure
the following attributes to ensure GoBGP communicates in the correct manner with other member ASNs.
Each confederated autonomous systems must configure the `[global.confederation.config]` with
`enabled = true` and `identifier = 30`. The identifier parameter is used to designate what the
confederation should present as it's ASN non-confederation members. Each member of the confederation
must also configure `member-as-list` with a list of other ASNs which compose the confederation. For
example, AS65001 would configure this attribute as `member-as-list = [ 65002 ]`.

```toml
[global.config]
as = 65001
router-id = "10.0.0.1"
  [confederation.config]
  enabled = true
  identifier = 30
  member-as-list = [ 65002 ]

[[neighbors]]
  [neighbors.config]
    peer-as = 65002
    neighbor-address = "10.0.0.2"
```

# BGP Confederation

This page explains how to configure BGP confederation feature when BGP peers
are part of a larger mesh representing a single autonomous system (AS).

## Prerequisites

Assume you finished [Getting Started](getting-started.md).

## Contents

- [Configuration](#configuration)

## Configuration

If AS30 is a confederation composed of AS65001 and AS65002, the confederation members must configure
the following attributes to ensure GoBGP communicates in the correct manner with other member ASNs.
Each confederated autonomous systems must configure the `[global.confederation.config]` with
`enabled = true` and `identifier = 30`. The identifier parameter is used to designate what the
confederation should present as it's ASN non-confederation members. Each member of the confederation
must also configure `member-as-list` with a list of other ASNs which compose the confederation. For
example, AS65001 would configure this attribute as `member-as-list = [ 65002 ]`.

```toml
[global]
  [global.config]
    as = 65001
    router-id = "10.0.0.1"
  [global.confederation.config]
    enabled = true
    identifier = 30
    member-as-list = [ 65002 ]

[[neighbors]]
  [neighbors.config]
    peer-as = 65002
    neighbor-address = "10.0.0.2"
```

Fix error in BGP Confederation syntax
Fix error in BGP Confederation syntax

Sorry about this, I had forgot that TOML subtables require the name of the parent table in their path's. I've validated this configuration:

```
root@kkirsche-dev:/home/kkirsche# ./gobgpd -f config.toml
{"level":"info","msg":"gobgpd started","time":"2019-08-28T18:32:23Z"}
{"Topic":"Config","level":"info","msg":"Finished reading the config file","time":"2019-08-28T18:32:23Z"}
{"level":"info","msg":"Peer 10.0.0.2 is added","time":"2019-08-28T18:32:23Z"}
{"Topic":"Peer","level":"info","msg":"Add a peer configuration for:10.0.0.2","time":"2019-08-28T18:32:23Z"}
```

```
root@kkirsche-dev:# cat config.toml
[global]
  [global.config]
    as = 65001
    router-id = "10.0.0.1"
  [global.confederation.config]
    enabled = true
    identifier = 30
    member-as-list = [ 65002 ]
```