Connecting to VK Cloud via Cloud Direct Connect in a fault-tolerant VRRP configuration
Cloud Direct Connect allows you to establish a connection between VK Cloud virtual networks and external network infrastructure (for example, your local networks) using a fault-tolerant L3 connection based on the VRRP protocol. For this purpose, a virtual IP address of the network gateway is used (VRRP VIP). If the active router fails, traffic directed to the VRRP VIP is switched to the backup router.
Fault tolerance of the L2 connection is ensured by physically duplicating the communication channel in two independent points of presence.
When organizing a Cloud Direct Connect connection with VRRP, the following are used:
- two dedicated Cloud Direct Connect communication channels;
- two advanced routers with dynamic routing via the BGP protocol;
- the VRRP protocol for creating a virtual IP address to serve as the gateway in the cloud network.
Advanced routers in this configuration are responsible for integration and provide communication with the remote infrastructure, as well as serve the network where virtual machines are hosted.
The connection option under consideration involves the use of three virtual networks:
- two independent network junction networks (Cloud Direct Connect);
- the cloud network where virtual machines are hosted and the virtual gateway IP address is formed.
This option assumes that each of the network junction networks is brought to its own advanced router individually and has the following features:
- exchange of address prefixes between the remote infrastructure and the cloud is performed using the eBGP protocol;
- exchange of address prefixes between advanced routers is performed using the iBGP protocol.
All together, this makes it possible to build a reliable fault-tolerant network integration of the cloud with external infrastructure.
The network connectivity scheme looks as follows:
-
Connect to the Cloud Direct Connect service if you have not done so already.
-
Activate API access if you have not done so 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.
-
Find out the UUIDs of the connected Cloud Direct Connect network junction networks:
- In the management console, go to the Virtual networks → Networks section.
- In the list of networks, find two network junction networks with names like
external-vni-10XXX. HereXXXis the individual sequential number of your connection. - Save the UUIDs of these networks. In this example, the UUIDs of the network junction networks are:
- the first junction network
external-vni-10XX1—b2b8468e-aaaa-bbbb-cccc-327c8c2670d4; - the second junction network
external-vni-10XX2—a2b8967e-aaaa-bbbb-cccc-327f9a2670e5.
- the first junction network
-
Determine the address prefixes (CIDRs) of the subnets in the local infrastructure that will be announced to the cloud using BGP routing.
-
Make sure that the routers of the local infrastructure connected to the Cloud Direct Connect service:
- are aware of the previously defined address prefixes and can announce them toward the cloud using BGP routing;
- interact with each other using the iBGP protocol;
- (optional) support the BFD protocol: this will reduce the routing recovery time in case of a failure.
-
Write down the IP address of the machine in the local infrastructure that will be used to verify connectivity between the networks.
-
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 CIDR.
- The IP address that is defined as the default gateway, for example
172.17.0.1. This address will be used when configuring VRRP. - The name of the network where the subnet resides.
-
Create a virtual machine in the selected network. Write down the IP address assigned to it.
-
Make sure all the information required for further work has been collected. In the following steps, the example uses the following data:
Object
Cloud network
Cloud Direct Connect network
Network
vkcloud-netexternal-vni-10XX1,b2b8468e-aaaa-bbbb-cccc-327c8c2670d4;external-vni-10XX2,a2b8967e-aaaa-bbbb-cccc-327f9a2670e5
Subnet
vkcloud-subnet,172.17.0.0/24Virtual machine
vkcloud-vm,172.17.0.8
After completing the steps described below, the resulting network connectivity scheme, taking addressing into account, should look as follows:
Here:
C.R1(ClientRouter1) is the first BGP router in the local infrastructure;C.R2(ClientRouter2) is the second BGP router in the local infrastructure;A.A.A.0/24is the first announced CIDR from the address space of the local networks;B.B.B.0/24is the second announced CIDR from the address space of the local networks;Adv.R1(AdvancedRouter1) is the first advanced router in the cloud;Adv.R2(AdvancedRouter2) is the second advanced router in the cloud;172.17.0.0/24is the announced CIDR from the cloud.
-
To the Cloud Direct Connect network junction network
external-vni-10XX1, add a subnet with a/30mask. When adding environment variables, specify the parameters:N_CIDR="192.168.0.0/30";N_ID="<UUID_СЕТЕВОГО_СТЫКА_1>".
Write down the subnet name and CIDR.
In this example, for the network
external-vni-10XX1:- subnet name:
dc-subnet1; - CIDR:
192.168.0.0/30; - UUID:
b2b8468e-aaaa-bbbb-cccc-327c8c2670d4.
-
To the Cloud Direct Connect network junction network
external-vni-10XX2, add a subnet with a/30mask. When adding environment variables, specify the parameters:N_CIDR="192.168.1.0/30";N_ID="<UUID_СЕТЕВОГО_СТЫКА_2>".
Write down the subnet name and CIDR.
In this example, for the network
external-vni-10XX2:- subnet name:
dc-subnet2; - CIDR:
192.168.1.0/30; - UUID:
a2b8967e-aaaa-bbbb-cccc-327f9a2670e5.
-
Create the first advanced router with the following parameters:
- Name: in this example,
AdvancedRouter1; - SNAT: the option is disabled.
- Name: in this example,
-
Create the second advanced router with the following parameters:
- Name: in this example,
AdvancedRouter2; - SNAT: the option is disabled.
- Name: in this example,
-
Add an interface of the first advanced router directed to the cloud network:
- Name:
vkcloud-net-iface1; - Subnet:
vkcloud-subnet; - Interface IP address:
172.17.0.253.
- Name:
-
Add an interface of the first 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.
- Name:
-
Add an interface of the second advanced router directed to the cloud network:
- Name:
vkcloud-net-iface2; - Subnet:
vkcloud-subnet; - Interface IP address:
172.17.0.254.
- Name:
-
Add an interface of the second advanced router directed to the Cloud Direct Connect network
external-vni-10XX2:- Name:
dc-iface2; - Subnet:
dc-subnet2; - Interface IP address:
192.168.1.1.
- Name:
-
Make sure the interfaces of the local infrastructure routers (
ClientRouter1,ClientRouter2) connected to the Cloud Direct Connect service are active. -
Configure static IP addressing on the routers using free IP addresses from the CIDRs of the Cloud Direct Connect networks.
In this example:
192.168.0.2is the interface of the first router into thedc-subnet1subnet of the junction networkexternal-vni-10XX1;192.168.1.2is the interface of the second router into thedc-subnet2subnet of the junction networkexternal-vni-10XX2;
-
(Optional) If the router supports BFD, configure the BFD protocol.
To establish a BGP connection, you need to add dynamic routes and specify BGP neighbors. To configure dynamic routing, use private autonomous system numbers (ASN) from the range 64512–65534. 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 the local infrastructure network;64512for the cloud networkvkcloud-net.
To configure dynamic routes on the advanced router via the junction network external-vni-10XX1:
-
In the management console, go to the Virtual networks → Routers section.
-
Open the advanced router
AdvancedRouter1and go to the Dynamic routing tab. -
Click the Create BGP router button.
-
Specify the BGP router parameters:
- Name:
to-ClientRouter1; - 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:
ClientRouter1; - Remote neighbor:
192.168.0.2; - Remote ASN:
65512.
- Name:
-
Click the Create button.
-
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 announcements to its neighbor immediately after successful BGP peering negotiation. Go to the BGP announcements tab and make sure the router sends announcements of all the networks its interfaces are directed to:
172.17.0.0/24;192.168.0.0/30.
All announcements must have green markers.
To establish a BGP connection, you need to add dynamic routes and specify BGP neighbors. To configure dynamic routing, use private autonomous system numbers (ASN) from the range 64512–65534. 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 the local network;64512for the cloud networkvkcloud-net.
To configure dynamic routes on the advanced router via the junction network external-vni-10XX2:
-
In the management console, go to the Virtual networks → Routers section.
-
Open the advanced router
AdvancedRouter2and go to the Dynamic routing tab. -
Click the Create BGP router button.
-
Specify the BGP router parameters:
- Name:
to-ClientRouter2; - Router ID:
192.168.1.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:
ClientRouter2; - Remote neighbor:
192.168.1.2; - Remote ASN:
65512.
- Name:
-
Click the Create button.
-
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 announcements to its neighbor immediately after successful BGP peering negotiation. Go to the BGP announcements tab and make sure the router sends announcements of all the networks its interfaces are directed to:
172.17.0.0/24;192.168.1.0/30.
All announcements must have green markers.
-
Connect to the router in your local network.
-
Specify the parameters for connecting via the BGP protocol through the network
external-vni-10XX1:-
Local network ASN:
65512. -
(Optional) Router ID:
192.168.0.2. -
External network ASN:
64512. -
BGP neighbor ID:
192.168.0.1. -
Use BFD — enable the option if you previously enabled it for the advanced routers of the cloud network. If the BFD protocol is used, make sure the BFD session is established.
-
-
Verify that a connection with the BGP neighbor has been established. If the BGP connection is established, the response should contain non-zero
keepalive-timeanduptimevalues. -
View all available BGP routes. The route list should include the networks
172.17.0.0/24and192.168.0.0/30.
-
Connect to the router in your local network.
-
Specify the parameters for connecting via the BGP protocol through the network
external-vni-10XX2:-
Local network ASN:
65512. -
(Optional) Router ID:
192.168.1.2. -
External network ASN:
64512. -
BGP neighbor ID:
192.168.1.1. -
Use BFD — enable the option if you previously enabled it for the advanced routers of the cloud network. If the BFD protocol is used, make sure the BFD session is established.
-
-
Verify that a connection with the BGP neighbor has been established. If the BGP connection is established, the response should contain non-zero
keepalive-timeanduptimevalues. -
View all available BGP routes. The route list should include the networks
172.17.0.0/24and192.168.0.0/30.
-
In the management console, go to the Virtual networks → Routers section.
-
Configure BGP peering for the first advanced router:
- Open the advanced router
AdvancedRouter1and go to the Dynamic routing tab. - Open the previously added BGP router and go to the BGP neighbors tab.
- Specify the parameters:
- Name: a logical name that makes it easy to identify the BGP neighbor, in this example
to-AdvancedRouter2; - Remote neighbor: the IP address of the BGP neighbor in VK Cloud, in this example
172.17.0.254; - Remote ASN: the remote ASN number used on the router in VK Cloud, in this example
64512.
- Name: a logical name that makes it easy to identify the BGP neighbor, in this example
- Click the Create button.
- Open the advanced router
-
Configure BGP peering for the second advanced router:
- Open the advanced router
AdvancedRouter2and go to the Dynamic routing tab. - Open the previously added BGP router and go to the BGP neighbors tab.
- Specify the parameters:
- Name: a logical name that makes it easy to identify the BGP neighbor, in this example
to-AdvancedRouter1; - Remote neighbor: the IP address of the BGP neighbor in VK Cloud, in this example
172.17.0.253; - Remote ASN: the remote ASN number used on the router in VK Cloud, in this example
64512.
- Name: a logical name that makes it easy to identify the BGP neighbor, in this example
- Click the Create button.
- Open the advanced router
-
In the management console, go to the Virtual Networks → Routers section.
-
Go to the VRRP tab and click the Add VRRP group button.
-
Specify the VRRP group name. In this example:
vrrp-group. -
Specify the subnet for which the virtual IP address will be created.
-
(Optional) Change the suggested Advertise timer parameter — the interval at which the master sends VRRP advertisement packets.
-
(Optional) Add a description for the VRRP group.
-
(Optional) Change the suggested Group number parameter.
-
Enable the VRRP group using the toggle switch.
-
Click the Add button.
-
Click the name of the created VRRP group in the list and go to the Interfaces tab.
-
Add an interface for the first router:
- Click the Add interface button.
- Specify the name of the interface that belongs to the first router in the group.
- Specify the desired state:
MasterorSlave. - (Optional) Change the priority value in the range from 0 to 255.
- (Optional) Change the Preempt option. When this option is enabled, the router with the highest priority will always become the master.
- Select the address of the interface that belongs to the first router from the list.
- Click the Add button.
-
Add an interface for the second router in the same way.
-
Go to the IP addresses tab and click the Add virtual IP button.
-
(Optional) Specify the name of the virtual IP address.
-
Specify the IP address that will be used as the virtual IP address of the VRRP group. Use the IP address that was set as the default gateway when creating the subnet. In this example,
172.17.0.1.
Send a ping or traceroute from one network to a machine in the connected network. If a response comes from the other network, the network connectivity setup was performed correctly.
For example, ping from the machine 172.17.0.8 in the virtual network to the machine 10.0.0.5 in the local network:
-
Open a terminal session with the VM
vkcloud-vm. -
Ping the internal IP address of the machine in the local network:
ping 10.0.0.5
The IP address should respond to the ping.
If you no longer need the created resources, delete them: