VK Cloud logo

Connecting to VK Cloud via two Cloud Direct Connect channels

Cloud Direct Connect allows you to connect the networks of your on-premises infrastructure to the virtual networks of VK Cloud. The following will show how to create a connection using:

  • two dedicated Cloud Direct Connect communication channels;
  • an advanced router with dynamic routing via the BGP protocol;
  • an additional standard router.

Two dedicated Cloud Direct Connect communication channels are laid with independent cables to two independent data centers of VK Cloud and form a fault-tolerant configuration.

The advanced router in this example is responsible for integration and provides communication with the remote infrastructure. The network hosting virtual machines is served by a standard router of VK Cloud.

The connection option under consideration involves the use of four virtual networks:

  • two independent network interconnect networks (Cloud Direct Connect);
  • a network for connecting the standard router to the advanced router (transit network);
  • a network for hosting virtual machines.

The network connectivity scheme looks as follows:

Network connectivity scheme

Preparation steps

  1. Activate API access if this has not been done yet.

  2. Make sure that the OpenStack client is installed, and pass authentication in the project.

  3. Make sure that the curl and jq packages are installed on your computer.

  4. Select or create a network in your on-premises infrastructure. The network may not have internet access, but it must be connected to two routers that:

    • support connection via the BGP protocol;
    • (optionally) support the BFD protocol: this will reduce the routing recovery time in case of a failure;
    • can be a device or a virtual machine in the customer network;
    • communicate with each other using the iBGP protocol.

    Write down the following information:

    • the name and IP address of the subnet;
    • the name of the network where the subnet is located;
    • the IP address of a machine in the subnet that will be used to verify connectivity between networks;
    • the names of the BGP routers.

    For example, a network with two Router OS 7.10 (MikroTik) virtual machines acting as BGP routers will be used.

  5. Select or create a virtual network in your project in VK Cloud. The network must not be connected to a router.

    Write down the following information:

    • the name and IP address of the subnet;
    • the name of the network where the subnet is located.
  6. Create a virtual machine in the selected network. Write down the IP address of the created VM.

  7. Create a transit virtual network in your project in VK Cloud. The network must not be connected to a router.

  8. Obtain the UUID of the transit network. In this example: 323d97cf-aaaa-bbbb-cccc-deaa6a11ab25.

  9. Connect to the Cloud Direct Connect service if this has not been done yet.

  10. Obtain the UUIDs of the connected Cloud Direct Connect network interconnect networks:

    1. In your management console, go to Virtual networks → Networks.
    2. In the list of networks, find two interconnect networks with names like external-vni-10XXX. Here XXX is the individual sequence number of your connection.
    3. Save the UUIDs of these networks. In this example, the UUIDs of the interconnect networks are:
      • the first interconnect network external-vni-10XX1: b2b8468e-aaaa-bbbb-cccc-327c8c2670d4;
      • the second interconnect network external-vni-10XX2: a2b8967e-aaaa-bbbb-cccc-327f9a2670e5.
  11. Make sure that all information necessary for further work has been collected. The following data is used as an example below:

    Object

    Customer network

    Virtual network

    Transit network

    Cloud Direct Connect network

    Network

    customer-net

    vkcloud-net

    transit-net, 323d97cf-aaaa-bbbb-cccc-deaa6a11ab25

    external-vni-10XX1, b2b8468e-aaaa-bbbb-cccc-327c8c2670d4 external-vni-10XX2, a2b8967e-aaaa-bbbb-cccc-327f9a2670e5

    Subnet

    customer-subnet, 10.0.0.0/24

    vkcloud-subnet, 172.17.0.0/24

    Connecting to VK Cloud via two Cloud Direct Connect channels

    Connecting to VK Cloud via two Cloud Direct Connect channels

    Virtual machine

    client-vm, 10.0.0.5

    vkcloud-vm, 172.17.0.8

    Connecting to VK Cloud via two Cloud Direct Connect channels

    Connecting to VK Cloud via two Cloud Direct Connect channels

    BGP router

    MikroTik

    Connecting to VK Cloud via two Cloud Direct Connect channels

    Connecting to VK Cloud via two Cloud Direct Connect channels

    Connecting to VK Cloud via two Cloud Direct Connect channels

1. Add subnets for Cloud Direct Connect

  1. To the Cloud Direct Connect interconnect network external-vni-10XX1, add a subnet with a /30 mask. When adding environment variables, specify the parameters:

    • N_CIDR="192.168.0.0/30";
    • N_ID="<INTERCONNECT_NETWORK_1_UUID>".

    Write down the name and CIDR of the subnet.

    In this example, for the external-vni-10XX1 network:

    • subnet name: dc-subnet1;
    • CIDR: 192.168.0.0/30;
    • UUID: b2b8468e-aaaa-bbbb-cccc-327c8c2670d4.
  2. To the Cloud Direct Connect interconnect network external-vni-10XX2, add a subnet with a /30 mask. When adding environment variables, specify the parameters:

    • N_CIDR="192.168.1.0/30";
    • N_ID="<INTERCONNECT_NETWORK_2_UUID>".

    Write down the name and CIDR of the subnet.

    In this example, for the external-vni-10XX2 network:

    • subnet name: dc-subnet2;
    • CIDR: 192.168.1.0/30;
    • UUID: a2b8967e-aaaa-bbbb-cccc-327f9a2670e5.

2. Add a subnet for the transit network

To the transit network, add a subnet with a /30 mask. When adding environment variables, specify the parameters:

  • N_CIDR="192.168.2.0/30";
  • N_ID="<TRANSIT_NETWORK_UUID>".

When creating the subnet via the API, pass the parameter "gateway_ip": <GATEWAY_IP_ADDRESS_FOR_THE_STANDARD_ROUTER>. In a Cloud Direct Connect subnet, this parameter is set to null.

Write down the name and CIDR of the subnet. In this example: transit-subnet, 192.168.2.0/30.

3. Add a standard router

Create a standard router with the following parameters:

  • SDN: Sprut. The field is displayed if both Sprut and Neutron SDNs are connected to the project.
  • Name: in this example, Standard router.
  • Connection to external network: the option is enabled.

4. Add an advanced router

Create an advanced router with the following parameters:

  • Name: in this example, Advanced router.
  • SNAT: the option is disabled.

5. Configure the network interfaces of the advanced router

  1. Add an interface of the advanced router directed to the virtual network:

    • Name: transit-net-iface;
    • Subnet: transit-subnet;
    • Interface IP address: 192.168.2.1.
  2. Add an interface of the advanced router directed to the Cloud Direct Connect network external-vni-10XX1:

    • Name: dc-iface1;
    • Subnet: dc-subnet1;
    • Interface IP address: 192.168.0.1.
  3. Add an interface of the advanced router directed to the Cloud Direct Connect network external-vni-10XX1:

    • Name: dc-iface2;
    • Subnet: dc-subnet2;
    • Interface IP address: 192.168.1.1.

6. Configure the network interfaces of the BGP routers in the customer network

  1. Add network interfaces for the first router:

    • One directed to the Cloud Direct Connect networks dc-subnet1. This interface will help establish connectivity between VK Cloud and the customer network.
    • One directed to the customer network where the BGP router is located. This interface is used to connect to resources within the network. The number of such interfaces depends on the network structure.

    In this example:

    • 192.168.0.2 — an interface to the dc-subnet1 subnet;
    • 10.0.0.15 — an interface to the customer network towards the virtual machine 10.0.0.5.
  2. Configure the interfaces of the first router using DHCP.

  3. Configure the system identifier (System ID).

  4. Prepare a list of networks for BGP advertisement.

  5. (Optional) If the router supports BFD, configure the BFD protocol.

  6. Add network interfaces for the second router:

    • One directed to the Cloud Direct Connect networks dc-subnet2. This interface will help establish connectivity between VK Cloud and the customer network.
    • One directed to the customer network where the BGP router is located. This interface is used to connect to resources within the network. The number of such interfaces depends on the network structure.

    In this example:

    • 192.168.1.2 — an interface to the dc-subnet2 subnet;
    • 10.0.0.16 — an interface to the customer network towards the virtual machine 10.0.0.5.
  7. Configure the interfaces of the second router using DHCP.

  8. Configure the system identifier (System ID).

  9. Prepare a list of networks for BGP advertisement.

  10. (Optional) If the router supports BFD, configure the BFD protocol.

7. Connect the transit network to the standard router

  1. In your management console, go to Virtual networks → Networks.

  2. Click the name of the transit network transit-net and go to the Network configuration tab.

  3. Select the standard router Standard router.

  4. Enable the Internet access option.

  5. Click the Save changes button.

  6. Verify the gateway registration for the subnet:

    1. In your management console, go to Virtual networks → Networks.
    2. Click the name of the transit network transit-net, then the name of the subnet transit-subnet, and go to the Ports tab.
    3. Make sure that the port with the gateway IP address is registered in the subnet and has the Connected status.

8. Configure eBGP peering for the advanced router via the first interconnect network

To establish communication via the BGP protocol, you need to add dynamic routes and specify BGP neighbors. To configure dynamic routing, use private autonomous system numbers (ASN) from the 64512–65534 range. The ASN numbers on the routers in VK Cloud and on the remote infrastructure side must differ. The example will use the following numbers:

  • 65512 for the customer-net network;
  • 64512 for the vkcloud-net network.

To configure dynamic routes on the advanced router via the external-vni-10XX1 interconnect network:

  1. In your management console, go to Virtual networks → Routers.

  2. Open the added advanced router and go to the Dynamic routing tab.

  3. Click the Create BGP router button.

  4. Specify the BGP router parameters:

    • Name: to-MikroTik1;
    • Router ID: 192.168.0.1;
    • ASN: 64512.
  5. Click the Create button.

  6. Open the added BGP router and go to the BGP neighbors tab.

  7. Add a BGP neighbor. Specify the parameters:

    • Name: MikroTik1;
    • Remote neighbor: 192.168.0.2;
    • Remote ASN: 65512.
  8. Click the Create button.

Make sure that the router has established a connection with the neighbor: the marker next to the name is green. If you use BFD, make sure that the BFD marker is also green.

The advanced router will start sending BGP advertisements to its neighbor immediately after successful BGP peering negotiation. Go to the BGP advertisements tab and make sure that the router sends advertisements for all networks to which its interfaces are directed:

  • 172.17.0.0/24;
  • 192.168.0.0/30;
  • 192.168.2.0/30.

All advertisements must have green markers.

9. Configure eBGP peering for the advanced router via the second interconnect network

To establish communication via the BGP protocol, you need to add dynamic routes and specify BGP neighbors. To configure dynamic routing, use private autonomous system numbers (ASN) from the 64512–65534 range. The ASN numbers on the routers in VK Cloud and on the remote infrastructure side must differ. The example will use the following numbers:

  • 65512 for the customer-net network;
  • 64512 for the vkcloud-net network.

To configure dynamic routes on the advanced router via the external-vni-10XX2 interconnect network:

  1. In your management console, go to Virtual networks → Routers.

  2. Open the added advanced router and go to the Dynamic routing tab.

  3. Click the Create BGP router button.

  4. Specify the BGP router parameters:

    • Name: to-MikroTik2;
    • Router ID: 192.168.1.1;
    • ASN: 64512.
  5. Click the Create button.

  6. Open the added BGP router and go to the BGP neighbors tab.

  7. Add a BGP neighbor. Specify the parameters:

    • Name: MikroTik;
    • Remote neighbor: 192.168.1.2;
    • Remote ASN: 65512.
  8. Click the Create button.

Make sure that the router has established a connection with the neighbor: the marker next to the name is green. If you use BFD, make sure that the BFD marker is also green.

The advanced router will start sending BGP advertisements to its neighbor immediately after successful BGP peering negotiation. Go to the BGP advertisements tab and make sure that the router sends advertisements for all networks to which its interfaces are directed:

  • 172.17.0.0/24;
  • 192.168.1.0/30;
  • 192.168.2.0/30.

All advertisements must have green markers.

10. Configure BGP peering for the customer network router via the first interconnect network

  1. Connect to the router in your local network.

  2. Specify the parameters for connecting via the BGP protocol through the external-vni-10XX1 network:

    • Local network ASN: 65512;
    • Router ID: 192.168.0.2;
    • External network ASN: 64512;
    • BGP neighbor ID: 192.168.0.1;
    • Use BFD.
  3. (Optional) Verify that a BFD protocol session has been established.

  4. Verify that a session with the BGP neighbor has been established. If the BGP connection is established, the response should contain non-zero keepalive-time and uptime values.

  5. View all available BGP routes. The route list should include the 172.17.0.0/24 and 192.168.0.0/30 networks.

11. Configure BGP peering for the customer network router via the second interconnect network

  1. Connect to the router in your local network.

  2. Specify the parameters for connecting via the BGP protocol through the external-vni-10XX2 network:

    • Local network ASN: 65512;
    • Router ID: 192.168.1.2;
    • External network ASN: 64512;
    • BGP neighbor ID: 192.168.1.1;
    • Use BFD.
  3. (Optional) Verify that a BFD protocol session has been established.

  4. Verify that a session with the BGP neighbor has been established. If the BGP connection is established, the response should contain non-zero keepalive-time and uptime values.

  5. View all available BGP routes. The route list should include the 172.17.0.0/24 and 192.168.0.0/30 networks.

12. Configure static routes to the customer network on the standard router

  1. In the personal dashboard, go to the Virtual networks → Routers section.
  2. Click the name of the standard router Standard router and go to the Static routes tab.
  3. Click the Add static route button.
  4. Specify the destination network: the address prefix of the customer network, in this example 10.0.0.0/24.
  5. Specify the next hop (Next HOP): the IP address of the advanced router.
  6. Click the Add route button.

13. Configure static routes to the VM network on the advanced router

  1. In the personal dashboard, go to the Virtual networks → Routers section.
  2. Click the name of the advanced router Advanced router and go to the Static routes tab.
  3. Click the Add static route button.
  4. Specify the destination network: the address prefix of the VM network, in this example 172.17.0.0/24.
  5. Specify the next hop (Next HOP): the IP address of the standard router.
  6. Click the Add button.

14. Add a static route to the VM network to the BGP announcement

  1. In the personal dashboard, go to the Virtual networks → Routers section.

  2. Click the name of the advanced router Advanced router and go to the Dynamic routing tab.

  3. Click the previously created BGP configuration and go to the BGP announcements tab.

  4. Click the Add new announcement button.

  5. Specify the parameters:

    • Announcement type: static.
    • Destination network: the address prefix of the VM network, in this example 172.17.0.0/24.
    • Default gateway: the IP address of the standard router.
  6. Click the Add button.

  7. Reboot the machines 172.17.0.8 and 10.0.0.5 so that the routes are added to their routing tables.

15. Verify that everything works

Send a ping or traceroute from one network to a machine in the connected network. If a response arrives from the other network, the network connectivity has been configured correctly.

For example, ping the machine 10.0.0.5 in the customer network from the machine 172.17.0.8 in the virtual network:

  1. Open a terminal session to the VM vkcloud-vm.

  2. Ping the internal IP address of the machine in the customer network:

    ping 10.0.0.5

The IP address should respond to the ping.

Delete unused resources

If you no longer need the created resources, delete them:

  1. Delete the virtual machine.
  2. Delete the routers.
  3. Delete the subnets and networks: the transit network and the network for hosting virtual machines.
Was this article helpful?