-
Notifications
You must be signed in to change notification settings - Fork 260
fix(tutorials): update 2 tutos for DHCP mentions #3948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-30.7 KB
tutorials/vpc-public-gateway-autoconfiguration/assets/scaleway-create-pg.webp
Binary file not shown.
Binary file removed
BIN
-38.8 KB
tutorials/vpc-public-gateway-autoconfiguration/assets/scaleway-create-pn.webp
Binary file not shown.
Binary file added
BIN
+54 KB
...als/vpc-public-gateway-autoconfiguration/assets/scaleway-vpc-attach-pgw-pn.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.2 KB
...s/vpc-public-gateway-autoconfiguration/assets/scaleway-vpc-attach-resource.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.2 KB
tutorials/vpc-public-gateway-autoconfiguration/assets/scaleway-vpc-create-pgw.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.8 KB
tutorials/vpc-public-gateway-autoconfiguration/assets/scaleway-vpc-create-pn.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.2 KB
...rials/vpc-public-gateway-autoconfiguration/assets/scaleway-vpc-ssh-bastion.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-21.5 KB
tutorials/vpc-public-gateway-autoconfiguration/assets/scaleway_add_instance.webp
Binary file not shown.
Binary file removed
BIN
-31.5 KB
...ials/vpc-public-gateway-autoconfiguration/assets/scaleway_vpc_add_instance.webp
Binary file not shown.
Binary file removed
BIN
-30.3 KB
...rials/vpc-public-gateway-autoconfiguration/assets/scaleway_vpc_dhcp_status.webp
Binary file not shown.
Binary file removed
BIN
-25.2 KB
...ateway-autoconfiguration/assets/scaleway_vpc_public_gateway_attach_network.webp
Binary file not shown.
Binary file removed
BIN
-21.2 KB
...c-public-gateway-autoconfiguration/assets/scaleway_vpc_public_gateway_list.webp
Binary file not shown.
Binary file removed
BIN
-32.6 KB
...rials/vpc-public-gateway-autoconfiguration/assets/scaleway_vpc_static_dhcp.webp
Binary file not shown.
Binary file removed
BIN
-38.9 KB
tutorials/vpc-public-gateway-autoconfiguration/assets/scaleway_vpc_static_nat.webp
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 **Savve 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 [email protected]: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 [email protected]:61000 [email protected]`. | ||
|
|
||
| ## Going further | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.