VK Cloud logo

Connecting to VK Cloud via the Cloud Direct Connect network

Cloud Direct Connect lets you organize various connection options for a network located in your local infrastructure to the virtual networks of VK Cloud. In this example, the connection will be created using a dedicated Cloud Direct Connect communication channel and an advanced router with dynamic routing over the BGP protocol.

In this configuration, the advanced router is the only router in the project and acts as the gateway for the virtual machines in the network connected to it. This is the simplest way to organize network connectivity with your local infrastructure and is suitable for testing or hosting an application in the cloud that does not require fault-tolerant network connectivity.

The network connectivity diagram looks as follows:

Network connectivity diagram

Configuration limitations:

  • You cannot use a floating IP address. DNAT (Destination NAT) translation can be configured as an alternative.
  • You cannot connect PaaS services, since their deployment requires internet access through public IP addresses of VK Cloud.
  • Available only on projects with SDN Sprut.

Preparatory steps

  1. Activate API access, if you have not done it already.

  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 local infrastructure. The network may not have internet access, but it must be connected to a router that:

    • supports connection over the BGP protocol;
    • (optional) supports 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.

    Record the following information:

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

    For this 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.

    Record the following information:

    • the subnet name and IP address;
    • the name of the network the subnet is in.
  6. Create a virtual machine in the selected network.

    Record the IP address of the VM.

  7. Connect to the Cloud Direct Connect service, if you have not done it already.

  8. Find out the UUID of the connected network:

    1. Go to the VK Cloud management console.
    2. Select the project.
    3. Go to the Virtual networks → Networks section.
    4. In the list of networks, find the network named external-vni-10XXX. Here XXX is the individual sequence number of your connection.
    5. Save the UUID of this network. In this example, the network interconnect UUID is b2b8468e-aaaa-bbbb-cccc-327c8c2670d4.
  9. Make sure you have gathered all the information needed for further work.

Object

Customer network

Virtual network

Cloud Direct Connect network

Network

customer-net

vkcloud-net

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

Virtual machine

10.0.0.5

172.17.0.8

Connecting to VK Cloud via the Cloud Direct Connect network

BGP router

MikroTik

Connecting to VK Cloud via the Cloud Direct Connect network

Connecting to VK Cloud via the Cloud Direct Connect network

1. Add a Cloud Direct Connect subnet

Add a subnet with a /30 mask to the Cloud Direct Connect network. When adding the environment variables, specify the N_ID="<NETWORK_INTERCONNECT_UUID>" parameter.

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

2. Add an advanced router

Create an advanced router with the following parameters:

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

3. Configure the network interfaces of the advanced router

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

    • Name: vkcloud-net-iface;
    • Subnet: vkcloud-subnet;
    • Interface IP address: 172.17.0.100.
  2. Add an advanced router interface directed to the Cloud Direct Connect network:

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

4. Configure the network interfaces of the customer network's BGP router

  1. Add network interfaces:

    • Directed to the Cloud Direct Connect network — dc-subnet. This interface will help establish connectivity between VK Cloud and the customer network.
    • Directed to the customer network where the BGP router is located. These interfaces are used to connect to resources inside the network. The number of such interfaces depends on the network structure.

    In this example:

    • 192.168.0.2 — the interface to the dc-subnet subnet;
    • 10.0.0.15 — the interface to the customer network, to the 10.0.0.5 virtual machine.
  2. Configure the interfaces using DHCP.

  3. Configure the System ID.

  4. Prepare the list of networks for the BGP announcement.

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

5. Configure eBGP neighborship for the advanced router

To configure connectivity over the BGP protocol, you need to add dynamic routes and specify BGP neighbors. Dynamic routing configuration requires autonomous system numbers — ASNs. Configuration should use private ASN numbers from the 64512–65534 range, and the ASN number on the routers in VK Cloud and on the remote infrastructure side must differ. 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 the Virtual networks → Routers section.

  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-MikroTik;
    • 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: MikroTik;
    • Remote neighbor: 192.168.0.2;
    • Remote ASN: 65512.
  8. Click the Create button.

Make sure the router has established connectivity 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 announcements to its neighbor immediately after the BGP neighborship is successfully negotiated. Go to the BGP announcements tab and make sure the router is sending announcements for all the networks its interfaces are directed to:

  • 172.17.0.0/24;
  • 192.168.0.0/30.

Both announcements should have green markers.

6. Configure BGP neighborship for the customer network's router

  1. Connect to the router in your local network.

  2. Specify the parameters for the BGP protocol connection:

    • 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) Make sure a BFD protocol connection is established.

  4. Make sure a connection with the BGP neighbor is established. If the BGP connection is established, the response should contain nonzero keepalive-time and uptime values.

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

7. Configure static routes between the networks

  1. Configure a static route from the vkcloud-net virtual network to the customer-net customer network through the advanced router:

    1. In the management console, go to the Virtual networks → Networks section.
    2. Select the vkcloud-net network and open the subnet properties.
    3. Select Show static routes field.
    4. Specify the route: 10.0.0.0/24 - 172.17.0.100.
    5. Click the Save button.
  2. Configure a static route from the customer-net customer network to the vkcloud-net virtual network through the customer network's BGP router. The route should be to 172.17.0.0/24 through 10.0.0.15.

  3. Reboot the 172.17.0.8 and 10.0.0.5 machines so that the routes appear in their routing table.

  4. Make sure the static routes are registered on the 172.17.0.8 VM, which is in the vkcloud-net virtual network:

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

    2. Run the command:

      ip route

      The route list should contain the 10.0.0.0/24 and 192.168.0.0/30 networks.

  5. Check the route list for the 10.0.0.5 machine, which is in the customer-net customer network. The route list should contain the 172.17.0.0/24 and 192.168.0.0/30 networks.

8. Check operability

To verify, send a ping or traceout to a machine in the opposite network. If you get a response from the other network, the network connectivity setup is correct.

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

  1. Open a terminal session with the vkcloud-vm 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 subnet and network in which the VM was placed.
Was this article helpful?