VK Cloud logo

Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

Cloud Direct Connect allows you to organize different connection options between a network located in your on-premises infrastructure and the VK Cloud virtual networks. In this example, the connection will be established using a dedicated Cloud Direct Connect communication channel, an advanced router with dynamic routing via the BGP protocol, and an additional standard router.

In this example, the advanced router handles the integration and provides connectivity to the remote infrastructure. The network hosting the virtual machines is served by the VK Cloud standard router.

The connection option described here involves the use of three virtual networks:

  • a network interconnect network (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 for the option using the BGP protocol looks as follows:

Network connectivity scheme

Using a combination of a standard router and an advanced router makes it possible to work around the limitations of the connection that does not use a standard router.

Preparatory steps

  1. Activate API access if you have not done so yet.

  2. Make sure the OpenStack client is installed, and authenticate in the project.

  3. Make sure 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 a router that:

    • supports a BGP protocol connection;
    • (optionally) supports the BFD protocol: this will reduce the routing recovery time in case of a failure;
    • can be either a physical device or a virtual machine in the client network.

    Write down the following information:

    • the subnet name and IP address;
    • the name of the network that contains the subnet;
    • the IP address of a machine in the subnet that will be used to verify connectivity between the networks;
    • the name of the BGP router.

    For example, a network with a Router OS 7.10 (MikroTik) virtual machine acting as the BGP router 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 subnet name and IP address;
    • the name of the network that contains the subnet.
  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. Get the UUID of the transit network. In this example: 323d97cf-aaaa-bbbb-cccc-deaa6a11ab25.

  9. Connect to the Cloud Direct Connect service if you have not done so yet.

  10. Get the UUID of the connected network interconnect network (Cloud Direct Connect):

    1. In the management console, go to Virtual networks → Networks.
    2. In the list of networks, find the network interconnect network named external-vni-10XXX. Here XXX is the individual sequential number of your connection.
    3. Save the UUID of this network. In this example, the network interconnect UUID is b2b8468e-aaaa-bbbb-cccc-327c8c2670d4.
  11. Make sure you have collected all the information needed for the subsequent steps. The following data is used as an example below:

    Object

    Client network

    Virtual network

    Transit network

    Cloud Direct Connect network

    Network

    customer-net

    vkcloud-net

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

    external-vni-10XXX, b2b8468e-aaaa-bbbb-cccc-327c8c2670d4

    Subnet

    customer-subnet, 10.0.0.0/24

    vkcloud-subnet, 172.17.0.0/24

    Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

    Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

    Virtual machine

    client-vm, 10.0.0.5

    vkcloud-vm, 172.17.0.8

    Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

    Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

    BGP router

    MikroTik

    Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

    Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

    Connecting to VK Cloud via the Cloud Direct Connect network and an additional standard router

1. Add a subnet for Cloud Direct Connect

Add a subnet with a /30 mask to the Cloud Direct Connect network interconnect network. When adding environment variables, specify the parameters:

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

Write down the subnet name and CIDR. In this example: dc-subnet, 192.168.0.0/30.

2. Add a subnet for the transit network

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

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

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

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

3. Add the standard router

Create a standard router with the following parameters:

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

4. Add the 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 pointing to the virtual network:

    • Name: transit-net-iface;
    • Subnet: transit-subnet;
    • Interface IP address: 192.168.1.1.
  2. Add an interface of the advanced router pointing to the Cloud Direct Connect network:

    • Name: dc-iface;
    • Subnet: dc-subnet;
    • Interface IP address: 192.168.0.1.

6. Configure the network interfaces of the client network BGP router

  1. Add the network interfaces:

    • One pointing to the Cloud Direct Connect network — dc-subnet. This interface will help establish connectivity between VK Cloud and the client network.
    • One pointing to the client 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 — interface to the dc-subnet subnet;
    • 10.0.0.15 — interface to the client network towards the virtual machine 10.0.0.5.
  2. Configure the interfaces 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.

7. Connect the transit network to the standard router

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

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

  3. Select the standard router Standard router.

  4. Enable the Internet access option.

  5. Click Save changes.

  6. Verify the gateway registration for the subnet:

    1. In the 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 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

To establish connectivity 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 be different. The example uses the following numbers:

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

To configure dynamic routes on the advanced router:

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

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

  3. Click Create BGP router.

  4. Specify the BGP router parameters:

    • Name: to-MikroTik;
    • Router ID: 192.168.0.1;
    • ASN: 64512.
  5. Click Create.

  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.0.2;
    • Remote ASN: 65512.
  8. Click Create.

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

The advanced router will start sending BGP advertisements to its neighbor immediately after the BGP peering is successfully established. Go to the BGP advertisements tab and make sure the router advertises all the networks its interfaces point to:

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

All advertisements must have green markers.

9. Configure BGP peering for the client network router

  1. Connect to the router in your on-premises network.

  2. Specify the parameters for the BGP protocol connection:

    • on-premises 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 connection has been established.

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

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

10. Configure static routes to the client network on the standard router

  1. In the management console, go to Virtual networks → Routers.
  2. Click the name of the standard router Standard router and go to the Static routes tab.
  3. Click Add static route.
  4. Specify the destination network: the address prefix of the client network, in this example 10.0.0.0/24.
  5. Specify the intermediate node (Next HOP): the IP address of the advanced router.
  6. Click Add route.

11. Configure static routes to the virtual machine network on the advanced router

  1. In the management console, go to Virtual networks → Routers.
  2. Click the name of the advanced router Advanced router and go to the Static routes tab.
  3. Click Add static route.
  4. Specify the destination network: the address prefix of the virtual machine network, in this example 172.17.0.0/24.
  5. Specify the intermediate node (Next HOP): the IP address of the standard router.
  6. Click Add.

12. Add a static route to the virtual machine network to the BGP advertisement

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

  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 advertisements tab.

  4. Click Add new advertisement.

  5. Specify the parameters:

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

  7. Reboot the machines 172.17.0.8 and 10.0.0.5 so that the routes get into their routing tables.

Verify the operation

To verify, send a ping or run a 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 client network from the machine 172.17.0.8 in the virtual network:

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

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

    ping 10.0.0.5

The IP address must 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 virtual machine hosting network.
Was this article helpful?