Creating a peer group

Dynamic Route Server for VPC is a beta feature that is available for evaluation and testing purposes to select customers. Access is restricted to allowlisted accounts.

You can create a peer group to logically group related peers, define their routing roles, configure health monitoring, and control, which routes the dynamic route server processes from those peers. Policies are applied at the peer group level.

Before you begin

Before you create a peer group:

Creating a peer group in the console

To create a peer group in the console, follow these steps:

  1. From your browser, open the IBM Cloud console and log in to your account.

  2. Select the Navigation menu Navigation menu icon, and then click Infrastructure VPC icon > Network > Dynamic route servers.

  3. In the list, select the row of the dynamic route server that you want to work with, and then click Create peer group +.

  4. Enter a name for the peer group, such as my-peer-group.

  5. Select one of the following peer roles:

    • Router - Use this role when the peer exchanges routes with the dynamic route server by using BGP. Suitable for routers, firewalls, SD-WAN devices that advertise and learn routes.

    • Next hop - Use this role when the peer is only a forwarding target, not a route source. Suitable for firewalls or appliances through which traffic must flow, but that don't need to advertise routes.

      Transit gateway peer groups can be set up only from the Transit Gateway service. For more information, see Adding a connection.

  6. Select one of the following health monitor modes:

    • BGP - Uses BGP session state to determine peer health. When the peer goes down, it automatically removes routes that use this peer as the next hop.
    • BFD over BGP - Uses Bidirectional Forwarding Detection (BFD) with BGP to monitor peer connectivity. Provides faster failure detection and quicker route withdrawal, more suitable for next-hop devices.
    • None (Next-hop only) - Disables peer health monitoring. Connectivity failures aren't automatically detected.
  7. Enable the peer group state to establish a BGP session with peers in the peer group.

Creating a prefix watcher

A prefix watcher is a rule that controls which routes from the peer group are allowed or denied by the dynamic route server before any policies are applied. It is an optional configuration. Use a prefix watcher to limit route intake, block unwanted prefixes, and reduce routing noise.

To create a prefix watcher in the console, follow these steps:

  1. In the Prefix watcher (optional) section, click Create.
  2. Select the Prefix type based on your requirements.
    • Monitored prefixes - Only routes that match these prefixes are eligible for use.
    • Excluded prefixes - Routes that match these prefixes are always ignored, even if monitored.
  3. Enter the Prefix, which is the network prefix along with its subnet mask (for example, 10.0.0.0/8), that you want to monitor or exclude.
  4. Optional: Enter values for GE (greater than or equal to) and LE (less than or equal to) to define the range of prefix lengths that match the rule.
    • GE specifies the minimum prefix length that is allowed to match.
    • LE specifies the maximum prefix length that is allowed to match.
    • For example, for a prefix of 10.0.0.0/8, setting GE = 16 and LE = 24 matches routes from /16 through /24 within the 10.0.0.0/8 address space. If you specify only GE, no upper limit exists on the prefix length. If you both GE and LE are blank, no prefix length constraint is applied, and the rule matches all routes within the prefix.
  5. Click Add to list to add the filter to the prefix watcher list. The prefix watcher is an ordered list of filters.

In the Peers section, click Attach to attach a peer. In the Policies section, turn on Create policy to create a peer group policy. Then, click Create peer group. For more information, see Attaching a peer to a peer group and Creating a peer group policy.

Creating a peer group from the CLI

To create a peer group for the dynamic route server from the CLI, follow these steps:

  1. Set up your CLI environment.

  2. Log in to your CLI environment. After you enter the password, the system prompts which account and region that you want to use:

    ibmcloud login --sso
    
  3. Enable the following feature flag:

    export IBMCLOUD_IS_FEATURE_DYNAMIC_ROUTE_SERVER=true
    
  4. Run the following command:

    ibmcloud is dynamic-route-server-peer-group-create DYNAMIC_ROUTE_SERVER (--roles next_hop | router | next_hop,router) (--peers PEERS_JSON | @PEERS_JSON_FILE) (--health-monitor-roles next_hop | router) [--health-monitor-mode bfd | bgp | none] [--name NAME] [--state disabled | enabled] [--excluded-prefixes EXCLUDED_PREFIXES_JSON | @EXCLUDED_PREFIXES_JSON_FILE] [--monitored-prefixes MONITORED_PREFIXES_JSON | @MONITORED_PREFIXES_JSON_FILE] [--output JSON] [-q, --quiet]
    

Where:

DYNAMIC_ROUTE_SERVER
The dynamic route server identifier.
--roles
A comma-separated list of peer group roles. One of: next_hop, router, or next_hop,router.
--peers
A JSON array that defines the peers. You can specify a minimum of one and a maximum of six peers. You can also add peers separately. For more information, see Attaching a peer to a peer group.
@PEERS_JSON_FILE
A file that contains the peers JSON payload.
--health-monitor-roles
A comma-separated list of roles for the health monitor configuration. One of: next_hop or router.
--health-monitor-mode
The health monitor mode. For the next_hop role, the options are bfd (default), bgp, or none. For the router role, the options are bfd or bgp (default).
--name
The name of the peer group.
--state
The peer group state. One of: disabled or enabled. The default is enabled.
--excluded-prefixes
A JSON array of CIDR prefixes to exclude from monitoring.
@EXCLUDED_PREFIXES_JSON_FILE
A file that contains the excluded prefixes JSON payload.
--monitored-prefixes
A JSON array of CIDR prefixes to monitor.
@MONITORED_PREFIXES_JSON_FILE
A file that contains the monitored prefixes JSON payload.
--output
Output in JSON format.
-q, --quiet
Suppresses verbose output.

After you create a peer group, attach a peer and create a peer group policy. For more information, see Attaching a peer to a peer group and Creating a peer group policy.

Creating a peer group with the API

To create a peer group with the API, follow these steps:

  1. Set up your API environment with the required variables.

  2. Store any additional variables to use in the API commands. For example:

    • ResourceGroupId - Find the resource group ID by using the get resource groups command and then populate the variable:
    export ResourceGroupId=<your_resourcegroup_id>
    
  3. When all variables are set, create the peer group.

    • To create a peer group with one to six peers, run the following command:
    curl -X POST \
      "$vpc_api_endpoint/v1/dynamic_route_servers/DRS_ID/peer_groups?version=$api_version&generation=2" \
      -H "Authorization: Bearer $iam_token" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "my-peer-group",
        "state": "enabled",
        "roles": ["next_hop", "router"],
        "health_monitor": {
          "mode": "bfd",
          "roles": ["next_hop"]
        },
        "peers": [
          {
            "name": "my-peer",
            "asn": 64520,
            "priority": 1,
            "endpoint": {
              "address": "10.40.38.2",
              "gateway": {
                "address": "10.30.40.5"
              }
            }
          }
        ]
      }'
    

After you create a peer group, attach a peer and create a peer group policy. For more information, see Attaching a peer to a peer group and Creating a peer group policy.

Next steps

Now that your peer group is created, consider these next steps: