Creating a VRF BGP Neighbor

This article describes how to create a VRF BGP interface neighbor. The figure below illustrates the BGP Neighbor relationship scenario followed in this article.

The first part of this article explains how to configure a BGP Interface Neighbor using the FlexSwitch CLI and the second part explains the process using the REST interface with examples in cURL.

Caution

This article applies only to configuring VRF BGP neighbors, see Creating a BGP Interface Neighbor for information about configuring a non-VRF BGP Neighbor.

Configuring a VRF BGP Neighbor Using the REST Interface

Port Configuration

Configure the Port

Use the following cURL request to configure the port.

localhost$ curl -X PATCH -H "Content-Type: application/json" -d '{"IntfRef": "fpPort1", "AdminState":"UP", "Speed":40000, "Autoneg":"OFF"}'  <host_ip_addr:8080>/public/v1/config/Port| python -m json.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   357  100   284  100    73  24704   6350 --:--:-- --:--:-- --:--:-- 25818
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "3f9b1b62-e41a-4bbf-7221-e666a309311f",
    "Result": "Success"
}

Verifying the Port Configuration

Use the following cURL GET request to verify that the port is properly configured.

localhost$ curl -X GET -H "Content-Type: application/json" -d '{"IntfRef": "fpPort1", "AdminState":"UP", "Speed":40000, "Autoneg":"OFF"}'  <host_ip_addr:8080>/public/v1/config/Port| python -m json.tool


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   590  100   517  100    73   251k  36300 --:--:-- --:--:-- --:--:--  504k
{
    "Object": {
        "AdminState": "UP",
        "Autoneg": "OFF",
        "BreakOutMode": "1x100",
        "Description": "",
        "DscpToCosProfileRef": "default",
        "Duplex": "Full_Duplex",
        "EnableFEC": false,
        "IfIndex": 60,
        "IntfRef": "fpPort1",
        "LoopbackMode": "NONE",
        "MacAddr": "a8:2b:b5:2e:df:ac",
        "MediaType": "Media Type",
        "Mtu": 9412,
        "PRBSPolynomial": "2^7",
        "PRBSRxEnable": false,
        "PRBSTxEnable": false,
        "PcpToCosProfileRef": "default",
        "PhyIntfType": "CR4",
        "SchedProfileRef": "default",
        "Speed": 40000,
        "StormControlProfile": "NONE"
    },
    "ObjectId": "3f9b1b62-e41a-4bbf-7221-e666a309311f"
}

IPv4 Interface Configuration

Configure the Interface

Use the following cURL Request to configure the interface.

localhost$ curl -H "Content-Type: application/json" -d '{"Vrf": "red", "IpAddr": "10.1.1.1/24", "IntfRef": "fpPort1"}' <host_ip_addr:8080>/public/v1/config/IPv4Intf | python -m json.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   345  100   284  100    61   3248    697 --:--:-- --:--:-- --:--:--  3264
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "a9e21544-68b1-424a-7f90-b1f548b4e886",
    "Result": "Success"
}

Verify the Configuration

Use the following cURL GET request to verify that the interface is correctly configured.

kjagwani@sirius:~$ curl -X GET -H "Content-Type: application/json" -d '{"Vrf": "red", "IpAddr": "10.1.1.1", "IntfRef": "fpPort1"}' http://192.168.100.18:8080/public/v1/config/IPv4Intf | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   193  100   135  100    58  69195  29728 --:--:-- --:--:-- --:--:--  131k
{
    "Object": {
        "AdminState": "UP",
        "IntfRef": "fpPort1",
        "IpAddr": "10.1.1.1/24",
        "Vrf": "red"
    },
    "ObjectId": "a9e21544-68b1-424a-7f90-b1f548b4e886"
}

VRF Feature Configuration

localhost$ curl -H "Content-Type: application/json" -d '{"Vrf": "red", "Name":"red"}' <host_ip_addr:8080>/public/v1/config/Vrf | python -m json.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   373  100   345  100    28   166k  13827 --:--:-- --:--:-- --:--:--  336k
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "d8f5d0f5-f371-4a2d-4b70-423952f64cf9",
    "Result": "Success"
}

BGP Configuration

Configure the BGP Global Object

localhost$ curl -X PATCH -H "Content-Type: application/json" -d '{"ASNum": "1", "RouterId": "1.1.1.1"}' <host_ip_addr:8080>/public/v1/config/BGPGlobal | python -m json.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   343  100   306  100    37   139k  17241 --:--:-- --:--:-- --:--:--  149k
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "7d9e5dfa-09da-4e48-6f1c-fc3b4261c685",
    "Result": "Success"
}

Configure the BGPVrf Object

localhost$ curl -H "Content-Type: application/json" -d '{"Name": "red", "UseMultiplePaths": true, "EBGPMaxPaths": 4, "IBGPMaxPaths": 4}' <host_ip_addr:8080>/public/v1/config/BGPVrf | python -m json.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   363  100   284  100    79  99614  27709 --:--:-- --:--:-- --:--:--  138k
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "25cd7953-a21b-4a78-5f0f-7afdf893139a",
    "Result": "Success"
}

Configure a BGP Vrf Neighbor

localhost$ curl -H "Content-Type: application/json" -d '{"Vrf": "red", "LocalAS": "1", "PeerAS": "2", "NeighborAddress": "10.1.1.2"}' <host_ip_addr:8080>/public/v1/config/BGPv4Neighbor | python -m json.tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   360  100   284  100    76  78713  21064 --:--:-- --:--:-- --:--:-- 94666
{
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
    "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PATCH, DELETE",
    "Access-Control-Allow-Origin": "*",
    "Access-Control-Max_age": "86400",
    "ObjectId": "553cfacb-265e-470e-50dc-7f97061d9273",
    "Result": "Success"
}