github.com/osrg/gobgp/v3@v3.30.0/docs/sources/peer-group.md (about) 1 # Peer Group 2 3 This page explains how to configure the Peer Group features. 4 With Peer Group, you can set the same configuration to multiple peers. 5 6 ## Contents 7 8 - [Prerequisite](#prerequisite) 9 - [Configuration](#configuration) 10 - [Verification](#verification) 11 12 ## Prerequisite 13 14 Assumed that you finished [Getting Started](getting-started.md). 15 16 ## Configuration 17 18 Below is the configuration to create a peer group. 19 20 ```toml 21 [[peer-groups]] 22 [peer-groups.config] 23 peer-group-name = "sample-group" 24 peer-as = 65001 25 [[peer-groups.afi-safis]] 26 [peer-groups.afi-safis.config] 27 afi-safi-name = "ipv4-unicast" 28 [[peer-groups.afi-safis]] 29 [peer-groups.afi-safis.config] 30 afi-safi-name = "ipv4-flowspec" 31 ``` 32 33 The configurations in this peer group will be inherited to the neighbors which is the member of this peer group. 34 In addition, you can add additional configurations to each member. 35 36 Below is the configuration to create a neighbor which belongs this peer group. 37 38 ```toml 39 [[neighbors]] 40 [neighbors.config] 41 neighbor-address = "172.40.1.3" 42 peer-group = "sample-group" 43 [neighbors.timers.config] 44 hold-time = 99 45 ``` 46 47 This neighbor belongs to the peer group, so the peer-as is 65001, and ipv4-unicast and ipv4-flowspec are enabled. 48 Furthermore, an additional configuration is set, the hold timer is 99 secs. 49 50 ## Verification 51 52 You can see the neighbor configuration inherits the peer group config by running `gobgp neighbor` command. 53 54 ```shell 55 $ gobgp neighbor 172.40.1.3 56 BGP neighbor is 172.40.1.3, remote AS 65001 57 BGP version 4, remote router ID 172.40.1.3 58 BGP state = established, up for 00:00:05 59 BGP OutQ = 0, Flops = 0 60 Hold time is 99, keepalive interval is 33 seconds 61 Configured hold time is 99, keepalive interval is 33 seconds 62 63 Neighbor capabilities: 64 multiprotocol: 65 ipv4-unicast: advertised and received 66 ipv4-flowspec: advertised and received 67 route-refresh: advertised and received 68 4-octet-as: advertised and received 69 Message statistics: 70 Sent Rcvd 71 Opens: 1 1 72 Notifications: 0 0 73 Updates: 0 0 74 Keepalives: 1 1 75 Route Refresh: 0 0 76 Discarded: 0 0 77 Total: 2 2 78 Route statistics: 79 Advertised: 0 80 Received: 0 81 Accepted: 0 82 ```