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:
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.
-
Activate API access if you have not done so yet.
-
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 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.
-
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.
-
Create a virtual machine in the selected network. Write down the IP address of the created VM.
-
Create a transit virtual network in your project in VK Cloud. The network must not be connected to a router.
-
Get the UUID of the transit network. In this example:
323d97cf-aaaa-bbbb-cccc-deaa6a11ab25. -
Connect to the Cloud Direct Connect service if you have not done so yet.
-
Get the UUID of the connected network interconnect network (Cloud Direct Connect):
- In the management console, go to Virtual networks → Networks.
- In the list of networks, find the network interconnect network named
external-vni-10XXX. HereXXXis the individual sequential 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 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-netvkcloud-nettransit-net,323d97cf-aaaa-bbbb-cccc-deaa6a11ab25external-vni-10XXX,b2b8468e-aaaa-bbbb-cccc-327c8c2670d4Subnet
customer-subnet,10.0.0.0/24vkcloud-subnet,172.17.0.0/24Virtual machine
client-vm,10.0.0.5vkcloud-vm,172.17.0.8BGP router
MikroTik
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.
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.
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.
Create an advanced router with the following parameters:
- Name: in this example,
Advanced router. - SNAT: the option is disabled.
-
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.
- Name:
-
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.
- Name:
-
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 thedc-subnetsubnet;10.0.0.15— interface to the client network towards the virtual machine10.0.0.5.
- One pointing to the Cloud Direct Connect network —
-
Configure the interfaces using DHCP.
-
Configure the system identifier (System ID).
-
Prepare a list of networks for BGP advertisement.
-
(Optional) If the router supports BFD, configure the BFD protocol.
-
In the management console, go to Virtual networks → Networks.
-
Click the name of the transit network
transit-netand go to the Network settings tab. -
Select the standard router
Standard router. -
Enable the Internet access option.
-
Click Save changes.
-
Verify the gateway registration for the subnet:
- In the management console, go to Virtual networks → Networks.
- Click the name of the transit network
transit-net, then the name of the subnettransit-subnet, and go to the Ports tab. - Make sure the port with the gateway IP address is registered in the subnet and has the Connected status.
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:
65512for thecustomer-netnetwork;64512for thevkcloud-netnetwork.
To configure dynamic routes on the advanced router:
-
In the management console, go to Virtual networks → Routers.
-
Open the added advanced router and go to the Dynamic routing tab.
-
Click Create BGP router.
-
Specify the BGP router parameters:
- Name:
to-MikroTik; - Router ID:
192.168.0.1; - ASN:
64512.
- Name:
-
Click Create.
-
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 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.
-
Connect to the router in your on-premises network.
-
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.
- on-premises network ASN:
-
(Optional) Verify that a BFD protocol connection has been established.
-
Verify that a connection with the BGP neighbor has been established. If the BGP connection is established, the response should include non-zero
keepalive-timeanduptimevalues. -
View all available BGP routes. The list of routes must include the
172.17.0.0/24and192.168.0.0/30networks.
- In the management console, go to Virtual networks → Routers.
- Click the name of the standard router
Standard routerand go to the Static routes tab. - Click Add static route.
- Specify the destination network: the address prefix of the client network, in this example
10.0.0.0/24. - Specify the intermediate node (Next HOP): the IP address of the advanced router.
- Click Add route.
- In the management console, go to Virtual networks → Routers.
- Click the name of the advanced router
Advanced routerand go to the Static routes tab. - Click Add static route.
- Specify the destination network: the address prefix of the virtual machine network, in this example
172.17.0.0/24. - Specify the intermediate node (Next HOP): the IP address of the standard router.
- Click Add.
-
In the management console, go to Virtual networks → Routers.
-
Click the name of the advanced router
Advanced routerand go to the Dynamic routing tab. -
Click the previously created BGP configuration and go to the BGP advertisements tab.
-
Click Add new advertisement.
-
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.
-
Click Add.
-
Reboot the machines
172.17.0.8and10.0.0.5so that the routes get into their routing tables.
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:
-
Open a terminal session with the VM
vkcloud-vm. -
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.
If you no longer need the created resources, delete them: