Attaching a peer to 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 attach a peer, such as firewalls, routers, SD-WAN devices, or a transit gateway, to a peer group to establish a BGP session between the dynamic route server and peer routing device.

Before you begin

Before you attach a peer to a peer group:

Attaching a peer to a peer group in the console

To attach a peer to 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 dynamic route server that you want to work with, and then click the Peer groups tab.

  4. Select the name of the peer group.

  5. In the Peer members section, click Create.

  6. In the Attach a peer panel, enter a name for the peer, such as my-peer.

  7. Enter the Peer ASN, which identifies the peer in the network.

  8. Select the Peer priority. A lower value indicates a higher priority. The default is 2.

  9. Turn on Peer state to establish a BGP session with the peer.

  10. Define how the dynamic route server identifies and connects to the peer. Click Select peer network to use an existing network, and then select the Peer VPC, Subnet, and Reserved IP. Alternatively, click Add peer network and specify the IP address and the gateway IP to add a new one.

  11. Click Save.

    A peer group must contain at least one peer. To remove the last peer, delete the peer group. Removing a peer also deletes all routes learned from it, and this action cannot be undone.

Attaching a peer to a peer group from the CLI

To attach a peer to a peer group 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-peer-create DYNAMIC_ROUTE_SERVER --peer-group PEER_GROUP --asn ASN --endpoint-rip ENDPOINT_RIP [--endpoint-rip-subnet ENDPOINT_RIP_SUBNET] [--vpc VPC] | --endpoint-address IP_ADDRESS [--gateway-address IP_ADDRESS] [--name NAME] [--state enabled | disabled] [--priority PRIORITY] [--output JSON] [-q, --quiet]
    

Where:

DYNAMIC_ROUTE_SERVER
The dynamic route server identifier.
--peer-group
The peer group identifier.
--asn
The autonomous system number (ASN) for the peer.
--endpoint-rip
The route interface port identifier.
--endpoint-rip-subnet
The subnet identifier associated with the endpoint route interface port.
--vpc
The VPC identifier associated with the endpoint.
--endpoint-address
The peer IP address.
--gateway-address
The gateway IP address.
--name
The name of the peer.
--state
The peer state. One of: enabled or disabled. The default is enabled.
--priority
The peer priority, from 0 to 4. Lower values have higher priority. The default is 2.
--output
Output in JSON format.
-q, --quiet
Suppresses verbose output.

Command examples

  • To attach a peer to a peer group, run the following command:

    ibmcloud is dynamic-route-server-peer-group-peer-create 0717-drs-12345678 --peer-group my-peer-group --asn 65001 --endpoint-address 192.168.10.10 --gateway-address 192.168.10.1 --name my-peer-1 --state enabled --priority 1 --output JSON
    

Attaching a peer to a peer group with the API

To attach a peer to 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, attach the peer to the peer group:

    curl -X POST \
      "$vpc_api_endpoint/v1/dynamic_route_servers/DRS_ID/peer_groups/PEER_GROUP_ID/peers?version=$api_version&generation=2" \
      -H "Authorization: Bearer $iam_token" \
      -H "Content-Type: application/json" \
      -d '{
        "asn": 64520,
        "state": "enabled",
        "priority": 1,
        "endpoint": {
          "address": "10.40.38.2",
          "gateway": {
            "address": "10.30.40.5"
          }
        }
      }'
    

Next steps

Now that you have attached a peer to the peer group, consider these next steps:

Create a peer group policy.