Cloud Network: create a virtual network and configure a security group
Cloud Network is a group of services for managing network connectivity in VK Cloud. These services enable data exchange between resources connected to a virtual network.
Similar to physical local networks, a virtual network has its own subnets — IP address ranges. When connecting to a virtual network, each cloud resource receives its own IP address and can exchange traffic both within its subnet and between different subnets of the same network.
Start working with Cloud Network in any convenient way:
- Use the guide to create your own virtual network with several virtual machines and configure traffic rules.
- Take the free training course to get familiar with the service capabilities.
After completing all the steps of this guide, you will:
- Create a virtual network with and without internet access.
- Create virtual machines with different options for connecting to networks.
- Create a security group in which you will configure rules for managing traffic.
- Create a security group for VMs to allow traffic transmission.
- Check network connectivity between VMs.
- Check internet access.
- Check connection to VMs via SSH.
-
Go to your VK Cloud management console.
-
Go to Virtual networks → Networks.
-
Create a network with internet access:
- Click the Create button.
- Set the network name:
test-network. - Select SDN:
Sprut(default). The setting is unavailable if only one SDN is connected to the project. - Enable the Internet access option.
- From the Router list, select
Create new. - Click the Add network button.
-
Create a network without internet access:
- Click the Create button.
- Set the network name:
test-network-2. - Select SDN:
Sprut(default). The setting is unavailable if only one SDN is connected to the project. - Disable the Internet access option.
- From the Router list, select
Create new. - Click the Add network button.
Create one VM with internet access and three VMs without internet access.
-
Go to your VK Cloud management console.
-
Go to Cloud Computing → Virtual machines.
-
Click the Add button.
-
In the Configuration block, set the VM parameters that match your requirements.
-
Fill in the General information block:
- Virtual machine name:
test-vm1. - Leave the other parameters unchanged.
- Virtual machine name:
-
In the Disk size and speed block, select the appropriate disk type and specify its size.
-
In the Network and firewall settings block, set the following parameters:
- Network:
External network (internet). - Virtual machine key:
Create a new key. - Firewall settings: add the
default,sshsecurity groups. - Leave the other settings unchanged.
- Network:
-
Click the Next step button.
-
In the Backup block, disable backup.
-
Click the Create button.
Creating the virtual machines may take some time, after which they will appear in the list. The SSH keys of the virtual machines will be downloaded to your computer.
-
Go to your VK Cloud management console.
-
Go to Virtual networks → Firewall settings.
-
Click the Add button.
-
Set the rule group name:
test-icmp. -
Select SDN:
Sprut(default). The setting is unavailable if only one SDN is connected to the project. -
Click the Create group button.
-
In the Inbound traffic block, create rules to manage traffic:
- Click Add rule.
- Select type:
ICMP. - Select remote address:
All IP addresses.
-
Click the Save rule button.
-
In the Outbound traffic block, create rules to manage traffic:
- Click Add rule.
- Select type:
ICMP. - Select remote address:
All IP addresses.
-
Click the Save rule button.
To send and receive traffic, assign a security group to the VM. Apply the following settings to the previously created VMs:
- Go to your VK Cloud management console.
- Go to Cloud Computing → Virtual machines.
- Click
for the virtual machine and select Firewall settings.
- Find the previously created security group in the list.
- Click Apply in the row with the security group.
- Click the Confirm button.
-
Go to your VK Cloud management console.
-
Go to Cloud Computing → Virtual machines.
-
For each VM in the
internetandtest-networknetworks, perform the following actions:test-vm1test-vm2test-vm3- Open the
test-vm1VM page by clicking its name in the list. - Go to the Console tab.
- Log in to the VM.
- Run the
ping <TEST_VM2_VM_IP_ADDRESS>command. Make sure that the packets arrive successfully.
- Open the
-
Go to your VK Cloud management console.
-
Go to Cloud Computing → Virtual machines.
-
Open the
test-vm4VM page by clicking its name in the list. -
Go to the Console tab.
-
Log in to the VM.
-
Ping an external resource on the internet using the command:
ping cloud.vk.comThere is no internet connection, so packet exchange does not occur.
-
Go to Virtual networks → Routers.
-
Find the router with the
test-network-2network and click its name. -
Click the Edit router button.
-
In the window that opens, enable the External network connection option.
-
Click the Save button.
-
Return to the
test-vm4VM page. -
Go to Cloud Computing → Virtual machines.
-
Click
for
test-vm4and select Reboot. -
Open the
test-vm4VM page by clicking its name in the list. -
Go to the Console tab.
-
Log in to the VM.
-
Ping an external resource on the internet using the command:
ping cloud.vk.comThe internet connection works correctly, so packet exchange occurs.
-
Open the terminal.
-
Go to the directory where the SSH keys for connecting to the created VMs were saved.
-
Make the key accessible only to the current user:
chmod 400 <PATH_TO_TEST_VM2_VM_KEY> -
Connect to the
test-vm2VM via the SSH protocol:ssh -i <PATH_TO_KEY> <USERNAME>@<FLOATING_IP>Make sure there are no connection errors.
Running VMs consume computing resources. If you no longer need them:
Take the free training course.
The theoretical part of the course explains how virtual networks, routers, and network access control systems work. In the practical part, you will create your own virtual network with a subnet, verify the resulting network topology in an interactive editor, and also get acquainted with routers and security groups in the VK Cloud management console.