

# Step 6: Create route server peer
<a name="route-server-tutorial-create-peer"></a>

A route server peer is a session between a route server endpoint and the device deployed in AWS (such as a firewall appliance or other network security function running on an EC2 instance). The device must meet these requirements: 
+ Have an elastic network interface in the VPC
+ Support BGP (Border Gateway Protocol)
+ Can initiate BGP sessions

**Note**  
We recommend you create one route server peer per route server endpoint for redundancy.

------
#### [ AWS Management Console ]

**To create a route server peer**

1. Open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. In the navigation path, choose **VPC** > **Route server peers** > **Create route server peer**.

1. Under **Details**, configure the following:
   + **Name**: Enter a name for your route server peer (up to 255 characters). Example: my-route-server-peer-01
   + **Route server endpoint ID**: Choose a route server endpoint from the dropdown. Optionally, choose **Create a route server endpoint** to create a new one.
   + **Peer address**: Enter the IPv4 address of the peer. Must be a valid IP address. The peer address must be reachable from the route server endpoint.
   + **Peer ASN**: Enter the ASN (Autonomous System Number) for the BGP peer. Value must be in range of 1-4294967295. The ASN should typically use private ranges (64512-65534 for 16-bit or 4200000000-4294967294 for 32-bit)
   + **Peer liveness detection**:
     + **BGP keepalive** (default): Standard BGP keep alive mechanism
     + **BFD**: Bidirectional Forwarding Detection for faster failover
   + (Optional) Under **Tags**, choose **Add new tag** to add key-value pair tags. Tags help identify and track AWS resources.

1. Review your settings and choose **Create route server peer**.

------
#### [ Command line ]

Use the following procedure to create a route server peer.

1. Command:

   ```
   aws ec2 create-route-server-peer --route-server-endpoint-id rse-1 --peer-address 10.0.2.3 --bgp-options PeerAsn=65001,PeerLivenessDetection=bfd
   ```

   Response:

   In the response, the state values can be `pending|available|deleting|deleted`.

   ```
   {
       "RouteServerPeer": {
           "RouteServerPeerId": "rsp-1",
           "RouteServerId": "rs-1",
           "VpcId": "vpc-1",
           "SubnetId": "subnet-1",
           "State": "pending",
           "EndpointEniId": "eni-2,
           "EndpointEniAddress": "10.0.2.4",
           "PeerEniId": "eni-1",
           "PeerAddress": "10.0.2.3",
           "BgpOptions": {
               "PeerAsn": 65001,
      "PeerLivenessDetection": "bfd"
           },
           "BgpStatus": {
               "Status": "Up"
           }
       }
   }
   ```

1. Wait for the propagation state to change to available.

   Command:

   ```
   aws ec2 describe-route-server-peers
   ```

   Response:

   ```
   {
       "RouteServerPeer": {
           "RouteServerPeerId": "rsp-1",
           "RouteServerId": "rs-1",
           "VpcId": "vpc-1",
           "SubnetId": "subnet-1",
           "State": "available",
           "EndpointEniId": "eni-2,
           "EndpointEniAddress": "10.0.2.4",
           "PeerEniId": "eni-1",
           "PeerAddress": "10.0.2.3",
           "BgpOptions": {
               "PeerAsn": 65001,
      "PeerLivenessDetection": "bfd"
           },
           "BgpStatus": {
               "Status": "down"
           }
       }
   }
   ```

------