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:
- Review Planning considerations for dynamic route servers.
- Review Known issues for dynamic route servers.
- Make sure that you have a peer group created. For more information, see Creating a peer group.
- Make sure that the peer endpoint isn't used by another peer in any peer group of the dynamic route server.
Attaching a peer to a peer group in the console
To attach a peer to a peer group in the console, follow these steps:
-
From your browser, open the IBM Cloud console and log in to your account.
-
Select the Navigation menu
, and then click Infrastructure
> Network > Dynamic route servers.
-
In the list, select the dynamic route server that you want to work with, and then click the Peer groups tab.
-
Select the name of the peer group.
-
In the Peer members section, click Create.
-
In the Attach a peer panel, enter a name for the peer, such as
my-peer. -
Enter the Peer ASN, which identifies the peer in the network.
-
Select the Peer priority. A lower value indicates a higher priority. The default is 2.
-
Turn on Peer state to establish a BGP session with the peer.
-
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.
-
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:
-
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 -
Enable the following feature flag:
export IBMCLOUD_IS_FEATURE_DYNAMIC_ROUTE_SERVER=true -
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:
enabledordisabled. The default isenabled. --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:
-
Set up your API environment with the required variables.
-
Store any additional variables to use in the API commands. For example:
ResourceGroupId- Find the resource group ID by using theget resource groupscommand and then populate the variable:
export ResourceGroupId=<your_resourcegroup_id> -
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: