Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tutorials/load-overflow-proxmox-and-elastic-metal/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories:
- load-balancer
- postgresql-and-mysql
dates:
validation: 2024-07-02
validation: 2024-11-05
posted: 2019-05-20
---

Expand Down Expand Up @@ -40,7 +40,7 @@ Finally, we can introduce and configure a Load Balancer to evenly distribute tra
- An [SSH key](/identity-and-access-management/organizations-and-projects/how-to/create-ssh-key/)
- 2 [Elastic Metal servers](/compute/instances/how-to/create-an-instance/) running on Proxmox
- [Created a Private Network](/network/vpc/how-to/create-private-network/) and added your resources to it
- [Created a Public Gateway](/network/public-gateways/how-to/create-a-public-gateway/) with DHCP enabled
- [Created a Public Gateway](/network/public-gateways/how-to/create-a-public-gateway/)
- A [domain or subdomain](/network/domains-and-dns/quickstart/) pointed to your Instance

## Preparing Proxmox
Expand Down Expand Up @@ -69,7 +69,7 @@ Create or clone your virtual machines on both servers of the cluster to distribu
<Message type="tip">
Make sure to select the bridge `vmbr1`, automatic MAC address generation, and select DHCP for LXC network configuration.
<Lightbox src="scaleway-px-create-vm.webp" alt="" />
The DCHP server in your Private Network will automatically assign a random IP address to your container or VM. If required, you can configure [static NAT](/network/public-gateways/how-to/configure-a-public-gateway/#how-to-review-and-configure-dhcp) to assign a static IP address to it.
We recommend that you use IPAM to assign an IP on the Private Network to each VM. You first need to [reserve](/network/ipam/how-to/reserve-ip/) an IP address for each machine, then use the IPAM API's [Attach IP to custom resource](https://www.scaleway.com/en/developers/api/ipam/#path-ips-attach-existing-ip-to-custom-resource) method to attach it by passing the VM's name and MAC address.
</Message>

## Configuring the Load Balancer
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
144 changes: 56 additions & 88 deletions tutorials/vpc-public-gateway-autoconfiguration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ categories:
- instances
tags: Private-Network instances Public-Gateway
dates:
validation: 2024-05-20
validation: 2024-11-05
---

## Private Networks and Public Gateways - Overview
Expand All @@ -31,113 +31,81 @@ dates:
ssh root@<your_instance_ip>
```

<Message type="tip">
You can connect to your Instance even if it does not have a [flexible IP address](/compute/instances/how-to/use-flexips/) by using its IPv6 address.
</Message>
<Message type="tip">
You can connect to your Instance using its flexible IPv4 or IPv6 address.
</Message>

2. Check the status of your network interfaces using the `ip a` command. You see the details of the default Ethernet adapter of your Instance:
```
2: ens2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether de:1c:a4:2b:d0:39 brd ff:ff:ff:ff:ff:ff
inet 10.70.104.113/31 scope global dynamic ens2
valid_lft 85983sec preferred_lft 85983sec
inet6 2001:bc8:634:c38::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::dc1c:a4ff:fe2b:d039/64 scope link
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether de:00:00:7b:1f:91 brd ff:ff:ff:ff:ff:ff
inet 51.158.99.14/32 metric 100 scope global dynamic enp0s1
valid_lft 771sec preferred_lft 771sec
inet6 2001:bc8:710:5c70:dc00:ff:fe7b:1f91/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86391sec preferred_lft 14391sec
inet6 fe80::dc00:ff:fe7b:1f91/64 scope link
valid_lft forever preferred_lft forever
```
3. Go to the [Private Networks page](https://console.scaleway.com/private-network/private-networks) of the Scaleway console.
4. Click **Create a new Private Network**. The Private Network creation wizard displays:
<Lightbox src="scaleway-create-pn.webp" alt="" />
5. Enter the details of the new Private Network and click **Create a Private Network**:
- Enter a **Name** for the Private Network
- Select the region for the Private Network

<Message type="note">
Make sure to create the Private Network in the same region as your Instance.
</Message>

Once completed, the list of your Private Networks displays.
6. Click on the Private Network's name to display its information.
7. Click the **Attached Resources** tab to see the list of Instances attached to the Private Network.
8. Select your Instance from the drop-down menu and click **Add Instance** to attach it to the Private Network:
<Lightbox src="scaleway_add_instance.webp" alt="" />
9. Use the `ip a` command on the Instance to verify the presence of the new Ethernet interface:
3. Go to the [VPC page](https://console.scaleway.com/vpc/vpc) of the Scaleway console.
4. Click the default VPC of the region that covers your Instance's Availability Zone.
5. Click **Create Private Network**. The Private Network creation wizard displays:
<Lightbox src="scaleway-vpc-create-pn.webp" alt="" />
6. Leave the default settings in place, or enter a customized **name**, **tags** and, in **Advanced Settings**, **CIDR block**.
7. Click **Create Private Network**.
The Private Network is created inside the specified VPC, and its **Overview** page displays.
8. Click the **Attached Resources** tab to see the list of Instances attached to the Private Network. Currently, no resources are attached.
9. Click **Attach resource** and select your Instance from the dropdown list that displays. Leave the default IPv4 and IPv6 address settings in place, or specify these addresses yourself if you prefer.
<Lightbox src="scaleway-vpc-attach-resource.webp" alt="" />
10. Click **Attach to Private Network**. You are returned to the **Attached resources** tab, where your Instance now displays.
11. Use the `ip a` command on the Instance to verify the presence of the new Ethernet interface:
```
3: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:00:00:00:5a:d8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::ff:fe00:5ad8/64 scope link
valid_lft forever preferred_lft forever
3: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 02:00:00:11:cf:fe brd ff:ff:ff:ff:ff:ff
inet 172.16.8.2/22 metric 50 brd 172.16.11.255 scope global dynamic enp1s0
valid_lft 86369sec preferred_lft 86369sec
inet6 fdf6:47af:d6e7:e60e:d4bf:b161:6073:1c8f/128 scope global dynamic noprefixroute
valid_lft 86371sec preferred_lft 71971sec
inet6 fe80::ff:fe11:cffe/64 scope link
valid_lft forever preferred_lft forever
```

The Instance is now added to the Private Network but no IP address has been configured. You can configure it manually or use DHCP autoconfiguration with a Public Gateway.
The Instance is now added to the Private Network, and the Private Network's inbuilt DHCP has assigned the IPv4 address `172.16.8.2/22` and the IPv6 address `fdf6:47af:d6e7:e60e:d4bf:b161:6073:1c8f/128`.

## Creating a Public Gateway

1. Go to the [Public Gateways page](https://console.scaleway.com/public-gateway/public-gateways) of the Scaleway console, and click **Create a Public Gateway**. The Public Gateway creation wizard displays:
<Lightbox src="scaleway-create-pg.webp" alt="" />
<Lightbox src="scaleway-vpc-create-pgw.webp" alt="" />
2. Enter the details of the new Public Gateway:
- Choose the Availability Zone of the Public Gateway.
- Select the Public Gateway offer
- Select the Public Gateway IP address. To create a new IP, select **Allocate new IP** in the drop-down list.
- Enter a name and optional tags for the Public Gateway
- Choose the Availability Zone of the Public Gateway. It must match the Availability Zone of your Instance.
- Select the Public Gateway offer type.
- Select the Public Gateway IP address. Either allocate a new IP, or use one of your existing Public Gateway flexible IPs.
- Enter a name and optional tags for the Public Gateway, or leave the default ones in place.
3. Click **Create a Public Gateway**. The Public Gateway is created, and you are taken to the list of your Public Gateways:
<Lightbox src="scaleway_vpc_public_gateway_list.webp" alt="" />
4. Click **Manage** to display the Public Gateway Information.
5. Click **+ Attach a new Private Network** to attach the previously created Private Network to the Public Gateway.
6. Select the Private Network from the drop-down list, then click **Attach Private Network**:
<Lightbox src="scaleway_vpc_public_gateway_attach_network.webp" alt="" />
7. Check if the IP address for the Private Network has been assigned to the Instance using the DHCP server of the Private Gateway by running the `ip a` command:
```
3: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:00:00:00:5a:d8 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.2/24 brd 192.168.0.255 scope global dynamic ens5
valid_lft 3513sec preferred_lft 3513sec
inet6 fe80::ff:fe00:5bea/64 scope link
valid_lft forever preferred_lft forever
```
4. Click the Public Gateway you just created to go to its dashboard.
5. Click the **Private Networks** tab, then **Attach to a Private Network**.
<Lightbox src="scaleway-vpc-attach-pgw-pn.webp" alt="" />
6. Configure the attachment:
- Select the Private Network you previously created from the drop-down list.
- Either choose a specific IPv4 address to use for the attachment, or leave the default auto-allocation option in place.
- Activate the toggle to [advertise the default route](/network/public-gateways/concepts/#default-route)
7. Click **Attach to Private Network**.

You can see the private IP address `192.168.0.2` has been configured automatically on the interface.
The Public Gateway is attached to the Private Network, and you are returned to the list of Private Networks for this gateway.

<Message type="note">
Once the Instance is added to the Private Network and autoconfigured through DHCP, it cannot be accessed through its public IPv4 address anymore. Later in this tutorial, we explain how to configure port forwarding to access your Instances through the Public Gateway's public IPv4 address.
Once the Instance and a Public Gateway advertising the default route are added to the same Private Network, the Instance cannot be accessed through its public IPv4 address anymore. You should use SSH bastion to access your Instances through the Public Gateway's public IPv4 address, as described in the next section.
</Message>

## Configuring port forwarding

Port forwarding allows you to configure a mapping of ports on the IP address of the Public Gateway to IP addresses and ports inside the Private Network. This allows you to access services on Instances in a Private Network without the need for a public IP address on each of them.

1. Return to the [Public Gateways page](https://console.scaleway.com/public-gateway/public-gateways) of the Scaleway console. The list of your Public Gateways displays.
2. Click <Icon name="more" /> > **More Info** next to the relevant Public Gateway to display its information.
3. Click the **DHCP** tab. Then click **View DHCP Status** to display the list of devices autoconfigured by the DHCP server:
<Lightbox src="scaleway_vpc_dhcp_status.webp" />

<Message type="tip">
As you can see in the screenshot above, both entries have the **dynamic** type. This means the DHCP server has dynamically assigned an IP address to each device. The assigned IP address may change and the port forwarding will stop working. To avoid this, configure a **static** lease.
</Message>
4. Copy the **MAC address** of the device you want to configure. Then click **Configure DHCP**.
5. Click **Edit** > **Add static association** and enter the MAC address and the private IP address for the Instance. Confirm by clicking <Icon name="validate" />
<Lightbox src="scaleway_vpc_static_dhcp.webp" />
6. Click the **NAT** tab to display the NAT configuration. 5. Click **Edit** > **Add static association** and enter the MAC address and the private IP address for the Instance. Confirm by clicking <Icon name="validate" />
<Lightbox src="scaleway_vpc_static_dhcp.webp" />
7. Click the **NAT** tab to display the NAT configuration. <Lightbox src="scaleway_vpc_static_nat.webp" />

You can now connect to your Instance using the IP address of the Public Gateway:

```
ssh root@<public_gateway_ip> -p 2202
```

You are now logged into the Instance using the IP address of the Public Gateway:

```
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-81-generic x86_64)
## Configuring and connecting via SSH bastion

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
SSH bastion allows you to make secure SSH connections to resources attached to a Public Gateway. In the case of our Instance, we could even detach its public IP addresses, and still connect via the gateway's public IP and the Instance's private IP on the Private Network.

root@my-first-instance:~#
```
1. Go to the [Public Gateways page](https://console.scaleway.com/public-gateway/public-gateways) of the Scaleway console, and click on the Public Gateway you created previously. Its **Overview** page displays.
2. In the **SSH bastion** panel, click **Activate**.
<Lightbox src="caleway-vpc-ssh-bastion.webp" alt="" />
3. Leave the default port in place, copy the SSH connection command, and click **Save SSH bastion settings**.
SSH bastion is activated, and all the SSH keys currently associated with your Scaleway Project are uploaded to the bastion.
4. Check that you can connect to your Instance via the gateway's bastion, with the `ssh -J bastion@212.47.227.11:61000 root@1<Private-IP-of-resource` command.Replace `<Private-IP-of-resource>` with the private IP address of your Instance on the Private Network, as established in the previous section. In this case, the command to use is `ssh -J bastion@212.47.227.11:61000 root@172.16.8.2`.

## Going further

Expand Down