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:
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.
-
Activate API access, if you have not done it already.
-
Make sure the OpenStack client is installed, and authenticate in the project.
-
Make sure the curl and jq packages are installed on your computer.
-
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.
-
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.
-
Create a virtual machine in the selected network.
Record the IP address of the VM.
-
Connect to the Cloud Direct Connect service, if you have not done it already.
-
Find out the UUID of the connected network:
- Go to the VK Cloud management console.
- Select the project.
- Go to the Virtual networks → Networks section.
- In the list of networks, find the network named
external-vni-10XXX. HereXXXis the individual sequence number of your connection. - Save the UUID of this network. In this example, the network interconnect UUID is
b2b8468e-aaaa-bbbb-cccc-327c8c2670d4.
-
Make sure you have gathered all the information needed for further work.
Object | Customer network | Virtual network | Cloud Direct Connect network |
|---|---|---|---|
Network |
|
|
|
Subnet |
|
| |
Virtual machine |
|
| |
BGP router |
|
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.
Create an advanced router with the following parameters:
- Name:
Advanced routerin this example; - SNAT: the option is disabled.
-
Add an advanced router interface directed to the virtual network:
- Name:
vkcloud-net-iface; - Subnet:
vkcloud-subnet; - Interface IP address:
172.17.0.100.
- Name:
-
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.
- Name:
-
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 thedc-subnetsubnet;10.0.0.15— the interface to the customer network, to the10.0.0.5virtual machine.
- Directed to the Cloud Direct Connect network —
-
Configure the interfaces using DHCP.
-
Configure the System ID.
-
Prepare the list of networks for the BGP announcement.
-
(Optional) If the router supports BFD, configure the BFD protocol.
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:
65512for thecustomer-netnetwork;64512for thevkcloud-netnetwork.
To configure dynamic routes on the advanced router:
-
In the management console, go to the Virtual networks → Routers section.
-
Open the added advanced router and go to the Dynamic routing tab.
-
Click the Create BGP router button.
-
Specify the BGP router parameters:
- Name:
to-MikroTik; - Router ID:
192.168.0.1; - ASN:
64512.
- Name:
-
Click the Create button.
-
Open the added BGP router and go to the BGP neighbors tab.
-
Add a BGP neighbor. Specify the parameters:
- Name:
MikroTik; - Remote neighbor:
192.168.0.2; - Remote ASN:
65512.
- Name:
-
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.
-
Connect to the router in your local network.
-
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.
- local network ASN:
-
(Optional) Make sure a BFD protocol connection is established.
-
Make sure a connection with the BGP neighbor is established. If the BGP connection is established, the response should contain nonzero
keepalive-timeanduptimevalues. -
View all available BGP routes. The route list should contain the
172.17.0.0/24and192.168.0.0/30networks.
-
Configure a static route from the
vkcloud-netvirtual network to thecustomer-netcustomer network through the advanced router:- In the management console, go to the Virtual networks → Networks section.
- Select the
vkcloud-netnetwork and open the subnet properties. - Select Show static routes field.
- Specify the route:
10.0.0.0/24 - 172.17.0.100. - Click the Save button.
-
Configure a static route from the
customer-netcustomer network to thevkcloud-netvirtual network through the customer network's BGP router. The route should be to172.17.0.0/24through10.0.0.15. -
Reboot the
172.17.0.8and10.0.0.5machines so that the routes appear in their routing table. -
Make sure the static routes are registered on the
172.17.0.8VM, which is in thevkcloud-netvirtual network:-
Open a terminal session with the
vkcloud-vmVM. -
Run the command:
ip routeThe route list should contain the
10.0.0.0/24and192.168.0.0/30networks.
-
-
Check the route list for the
10.0.0.5machine, which is in thecustomer-netcustomer network. The route list should contain the172.17.0.0/24and192.168.0.0/30networks.
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:
-
Open a terminal session with the
vkcloud-vmVM. -
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.
If you no longer need the created resources, delete them: