Networks#
Virtual networks enable flexible configuration and isolation of network communication between virtual servers in cloud infrastructure. It supports creating external and internal networks, managing subnets (IPv4/IPv6), configuring gateways, DHCP, and connecting servers via network ports.
After connecting a network to a virtual server, an additional network interface appears automatically and can be configured at the operating system level, for example, via netplan in Linux.
Network creation#
You can create either an external or an internal network.
External virtual network
An external virtual network is created automatically when you create the first virtual server with external internet access in a specific region.
Each region can have only one external network.
An external network is automatically deleted if it has no ports by the end of a calendar month.
Important
You cannot delete an externally created network manually.
Charges apply only to external IP addresses assigned to ports in the external network. There is no charge for the existence of an external network without ports and without assigned external IP addresses.
Internal virtual network
To create an internal virtual network:
In the Control panel go to the Cloud → Networks section and click Create.
Select a region.
The network will be available in all availability zones of the selected region.
The following regions are available:
Warsaw, Poland
Miami, USA
Dallas, USA
San Francisco, USA
Manila, Philippines
Almaty, Kazakhstan
Select the appropriate options or leave the default values (you can enable the required parameters after network creation):
Turn on network — the network will be enabled immediately after creation.
Create subnet — creates a subnet associated with the network.
Set the Network name (Latin letters, numbers, and reasonable symbols are allowed).
To finish, click Create network.
The created internal network can be found in Cloud → Networks.
Subnet creation#
To create a new subnet:
Select the Create subnet checkbox on the network creation page to open subnet configuration fields.
Select the tab for the future subnet, for example, IPv4.
To configure an IPv4 subnet, enter the Subnet name (Latin letters, numbers, and reasonable symbols are allowed).
Enter the desired Subnet address in CIDR format (for example, 192.168.0.1/24).
In the IP Gateway field, select the appropriate option from the dropdown list:
Do not set a gateway.
Set default gateway.
Set gateway IP manually (an additional field will appear where you must enter the gateway IP address).
If the subnet requires a DHCP server, enable the corresponding checkbox and specify the start and end IP addresses of the pool, as well as the DNS servers to be assigned.
Connection to the virtual server#
To connect the virtual network to the virtual server:
Go to Cloud → Virtual servers.
Select the required server and click More.
On the server page, go to the Ports section and click Create.
In the list that appears, select the required network. Only networks from the server’s region will be shown.
You can connect an existing free port or create a new one. The IP address field is optional.
If a DHCP server is configured in the subnet, the IP address will be assigned automatically.
Click Save.
A new entry with the assigned IP address will appear in the Ports section. A new interface will appear automatically on the server; reboot is not required.
Port management#
You can create a new port for an external or internal network on the network page in the Ports tab. To do this, go to Cloud → Networks in the Control Panel. Select the required network and click More.
Adding the port
To add the new port:
Go to Cloud → Networks.
Select the required network and click More.
On the opened page, go to the Ports tab and click Add port.
Select a server from the list to connect the new port to, or select a dash if you want to create an empty port.
If necessary, enter an IP address.
Click Add.
Connecting the port
To connect the port:
Go to Cloud → Networks.
Select the required network and click More.
On the opened page, go to the Ports tab and select the required free port from the list.
A free port has no connected device entry and the Connect button is active.
Click Connect.
In the list that appears, select the server you want to connect the port to.
Click Connect port.
Hint
You can connect an already created port to a server both during new server creation and to an existing server on the virtual server page in the Ports section.
Disconnecting the port
To disconnect the port:
Go to Cloud → Networks.
Select the required network and click More.
On the opened page, go to the Ports tab and select the required port from the list.
Click Disconnect. The port will be disconnected immediately.
Important
A port with IPv4 and IPv6 addresses will remain in the list and will be available for connection to another virtual server.
Attention
When disconnecting a port in an external network, the public IPv4 address will continue to be billed until it is deleted.
Deleting the port
To delete the port:
Go to Cloud → Networks.
Select the required network and click More.
On the opened page, go to the Ports tab and select the required port from the list.
Click the trash icon. The port will be deleted immediately.
Setting up an internal network on a Linux virtual server#
After adding ports to a virtual server with an internal network, you need to make sure that interfaces appear on the server. Consider an example using a virtual server with Ubuntu.
Enter the ip a command:
root@test-ubu:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:16:3e:a7:06:e8 brd ff:ff:ff:ff:ff:ff
inet 45.139.24.57/24 brd 45.139.24.255 scope global dynamic eth0
valid_lft 85975sec preferred_lft 85975sec
inet6 2a0f:1140:100::65/128 scope global dynamic noprefixroute
valid_lft 85977sec preferred_lft 85977sec
inet6 fe80::f816:3eff:fea7:6e8/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:16:3e:f0:d9:27 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.32/24 brd 192.168.0.255 scope global dynamic eth1
valid_lft 85975sec preferred_lft 85975sec
inet6 fe80::f816:3eff:fef0:d927/64 scope link
valid_lft forever preferred_lft forever
The eth1 interface is the internal network in this case.
It is a possible case when the eth1 interface has not run.
root@test-ubu:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00eth1:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:16:3e:a7:06:e8 brd ff:ff:ff:ff:ff:ff
inet 45.139.24.57/24 brd 45.139.24.255 scope global dynamic eth0
valid_lft 86390sec preferred_lft 86390sec
inet6 2a0f:1140:100::65/128 scope global dynamic noprefixroute
valid_lft 86391sec preferred_lft 86391sec
inet6 fe80::f816:3eff:fea7:6e8/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether fa:16:3e:f0:d9:27 brd ff:ff:ff:ff:ff:ff
In this case it’s necessary to make changes to the /etc/netplan/50-cloud-init.yaml file using any text editor.
An example of a file with standard settings.
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp0:
dhcp4: yes
dhcp6: yes
Make changes using the nano text editor:
nano /etc/netplan/50-cloud-init.yaml
Open the file and make changes for eth1:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp0:
dhcp4: yes
dhcp6: yes
eth1:
dhcp4: yes
Next, save the file with the Ctrl+O key combination and exit the text editor with the Ctrl+X key combination.
To save the netplan settings and do not reset it after a reboot enter the netplan apply command.
netplan apply
It is possible to see using the ip a command if the local network managed to run the eth1 interface or not.
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:16:3e:a7:06:e8 brd ff:ff:ff:ff:ff:ff
inet 45.139.24.57/24 brd 45.139.24.255 scope global dynamic eth0
valid_lft 86396sec preferred_lft 86396sec
inet6 2a0f:1140:100::65/128 scope global dynamic noprefixroute
valid_lft 86398sec preferred_lft 86398sec
inet6 fe80::f816:3eff:fea7:6e8/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:16:3e:f0:d9:27 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.32/24 brd 192.168.0.255 scope global dynamic eth1
valid_lft 86396sec preferred_lft 86396sec
inet6 fe80::f816:3eff:fef0:d927/64 scope link
valid_lft forever preferred_lft forever
Configuring Static IP on eth1
If you need to configure a static IP on eth1:
nano /etc/netplan/50-cloud-init.yaml
Open the file and make changes for eth1:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp0:
dhcp4: yes
dhcp6: yes
eth1:
dhcp4: no
addresses: [192.168.0.30/24]
routes:
- to: default
via: 192.168.0.1
mtu: 1500
nameservers:
addresses: [IP DNS Server 1, IP DNS Server 2]
To save the netplan settings and not to let them being reset after reboot:
netplan apply