Set up a third-party internet connection
The connection is organized over a private network at the L3 level through a global router. To organize the connection, you create a global router network — connect devices that need internet from the operator to the global router. A docking subnet is added to the global router network with the operator's router, and NAT is configured on the operator's router for access from the private network to the Internet.
When connecting to the Internet using Direct Connect, you cannot assign public IP addresses from the operator's pool to your servers. To do this, find another way to connect to the Internet.
- Check that you have connected the Direct Connect service — physical port.
- Check or create a global router network.
- Connect the Direct Connect network to a global router.
- Check the settings on the operator side.
- Configure routing to the Direct Connect subnet on the global router network.
- Configure routing to the Internet on the global router.
1. Check that the Direct Connect service is connected — physical port
- Make sure you receive a VLAN number on the service order ticket to which the carrier port will be added.
- Make sure that this VLAN appears in the control panel: from the top menu, click Products → Dedicated Servers → Network → VLAN tab.
2. Verify or create a global router network
Make sure that your account has a global router network and includes all devices from which you want to access the Internet through your carrier. You can view the created global routers and their networks in the Control Panel under Network Services → Selectel Global Router.
If you do not already have a global router network or want to create a new one, use the instructions Create a private connection through a global router.
3. Connect the Direct Connect subnet to the global router
- In the control panel, click Products in the top menu and select Selectel Global Router.
- Open the router page → Networks tab.
- Click Create Network.
- Enter a network name, this will only be used in the control panel.
- Select a Servers and Hardware service.
- Select the pool you specified when ordering Direct Connect service — physical port.
- Select the VLAN to which the operator port has been added. You can see the VLAN number on the ticket you received when ordering Direct Connect service — physical port. If the port on the carrier router is configured in trunk mode, specify the Q-in-Q tag, a number from 2 to 4094.
- Enter the subnet name — this will only be used in the control panel.
- Enter the CIDR — IP address and mask of the private subnet. You can select any addressing that does not overlap with other subnets on the global router.
- Enter the gateway IP address or leave the first address from the subnet assigned by default. Do not assign this address to your devices to avoid disrupting the network.
- Enter service IPs or leave the last addresses from the subnet assigned by default. Do not assign these addresses to your devices to avoid disrupting the network.
- Click Create Network.
- Optional: Check the network topology on the global router. In the control panel, in the top menu, click Products → Selectel Global Router → Router page → click Network Map.
4. Check the settings on the operator side
Contact the operator and make sure they have made the settings on their side:
- assigned to the router an IP address from the Direct Connect subnet that you connected to the global router. The address must not be the same as the gateway address and service addresses you selected when you connected. You can view the gateway address and service addresses in the control panel: from the top menu, click Products→ Selectel Global Router → Router page → open the card of the network to which the subnet belongs → the Gateway field.
- configured the router to NAT from an IP address on the Direct Connect subnet to a public IP address from its address pool.
5. Configure routing to the Direct Connect subnet on the global router network
On all devices on the global router network, write static routes to the Direct Connect subnet you connected to the global router.
As next-hop, specify the IP address from the device subnet that is assigned to the global router as the gateway. You can view the gateway address in the control panel: from the top menu, click Products → Global Router → Global Router page → open the card of the network to which the subnet belongs → the Gateway field.
Dedicated server, cloud based on VMware
Cloud platform
Ubuntu
Debian
CentOS
Windows
-
Open the network configuration file with the
vi
text editor:vi /etc/netplan/01-netcfg.yaml
-
At the end of the data block of the desired network interface, add a route:
routes:
- to: <ip_address>/<mask>
via: <gateway>Specify:
<ip_address>/<mask>
— The IP address of the Direct Connect subnet that you connected to the global router with a mask;<gateway>
— gateway for the current server subnet, which is specified on the global router.
-
Press the
ESC
key. -
Exit the
vi
text editor with your changes saved::wq
-
Check the settings:
sudo netplan try
-
Apply the changes:
netplan apply
-
Open the network configuration file with the
vi
text editor:vi /etc/network/interfaces
-
At the end of the data block of the desired network interface, add the desired route:
up route add -net <ip_address> netmask <mask> gw <gateway>
down route del -net <ip_address> netmask <mask> gw <gateway>Specify:
<ip_address>
— The IP address of the Direct Connect subnet that you connected to the global router;<mask>
— subnet mask of the subnet to which you want to route, for example,255.255.255.0
;<gateway>
— gateway for the current server subnet, which is specified on the global router.
-
Press the
ESC
key. -
Exit the
vi
text editor with your changes saved::wq
-
Restart the network:
sudo /etc/init.d/networking restart
-
Create and complete a file to configure static routes:
echo "<ip_address>/<mask> via <gateway>" >> /etc/sysconfig/network-scripts/route-<eth_name>
Specify:
<ip_address>/<mask>
— The IP address of the Direct Connect subnet that you connected to the global router with a mask;<gateway>
— gateway for the current server subnet, which is specified on the global router;<eth_name>
— the name of the local network interface.
-
Restart the network:
systemctl restart network
-
Add a route:
route -p ADD <ip_address> MASK <mask> <gateway> METRIC <x>
Specify:
<ip_address>
— The IP address of the Direct Connect subnet that you connected to the global router;<mask>
— subnet mask of the subnet to which you want to route, for example,255.255.255.0
;<gateway>
— gateway for the current server subnet, which is specified on the global router;<x>
— parameter from 1 to 9999 that defines the priority of the specified gateway, 1 being the highest priority.
For a cloud server, cloud database cluster, or Managed Kubernetes cluster, use the Static Routes instruction.
6. Configure routing to the Internet on a global router
Configure a route on the Internet to the default network 0.0.0.0/0
. You can specify a static route or configure dynamic routing via BGP.
Prescribe static routes
Configure dynamic routing over BGP
- In the Control Panel, go to Network Services → Selectel Global Router.
- Open the router page → Static Routes tab.
- Click Create Route.
- Enter a route name — any name, it will only appear in the control panel.
- Enter the CIDR of the destination subnet —
0.0.0.0/0.
. - Enter the Next hop IP address — the IP address from the Direct Connect subnet that is assigned to the carrier router.
- Click Create.
- In the Control Panel, go to Network Services → Selectel Global Router.
- Open the router page → BGP tab.
- Click Configure BGP.
- Enter the BGP neighbor IP address, which is the IP address from the Direct Connect subnet that is assigned to the carrier router.
- Enter the Autonomous System (AS) number. You can specify a private AS from the range 64512-65534, except AS 64530, which is used for the global router.
- Describe a task that requires dynamic routing over BGP — accessing the Internet through a carrier.
- Click Create Ticket.
- Wait for a Selectel employee to respond to your ticket. He/she will clarify the details and send further instructions on how to organize the connection.