|
1 | 1 | --- |
2 | 2 | meta: |
3 | | - title: I cannot connect to my Instance using SSH after attaching it to a Private Network which has a Public Gateway |
| 3 | + title: I cannot connect to my Instance using SSH after attaching it to a Private Network with a Public Gateway |
4 | 4 | description: This page explains how troubleshoot connection problems after attaching an Instance to a Private Network which has a Public Gateway |
5 | 5 | content: |
6 | | - h1: I cannot connect to my Instance using SSH after attaching it to a Private Network which has a Public Gateway |
| 6 | + h1: I cannot connect to my Instance using SSH after attaching it to a Private Network with a Public Gateway |
7 | 7 | paragraph: This page explains how troubleshoot connection problems after attaching an Instance to a Private Network which has a Public Gateway |
8 | 8 | tags: troubleshoot error private-network private network vpc public-gateway |
9 | 9 | dates: |
10 | | - validation: 2024-05-24 |
| 10 | + validation: 2024-10-21 |
11 | 11 | posted: 2021-05-26 |
12 | 12 | categories: |
13 | 13 | - network |
14 | 14 | --- |
15 | 15 |
|
16 | | -<Macro id="requirements" /> |
| 16 | +If you are having trouble [connecting to your Instance via SSH](/compute/instances/how-to/connect-to-instance/), when the Instance is attached to a Private Network which also has an attached Public Gateway, read on for help and solutions. |
17 | 17 |
|
18 | | -- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 18 | +The action to take depends on whether: |
19 | 19 |
|
20 | | -The action to take depends on whether the Private Network(s) your Instance is on have DHCP enabled, and whether your Public Gateway is set to advertise a default route (true by default). |
| 20 | +- The Private Network(s) attached to your Instance have [DHCP enabled](/network/vpc/how-to/activate-dhcp/), and |
| 21 | +- Your Public Gateway is set to [advertise a default route](/network/public-gateways/concepts/#default-route) (true by default). |
21 | 22 |
|
22 | | -If it is not the case, disconnect the Instance from the Private Network, as there may be other factors impacting your Instance, like one of your Instances running a DHCP server. |
| 23 | +If the above two conditions are not true, there may be other factors impacting your Instance, like one of your Instances running a DHCP server. Try disconnecting and reconnecting the Instance from the Private Network. |
23 | 24 |
|
24 | | -If DHCP is activated and your Public Gateway is set to advertise a default route, this is expected behavior as all the traffic towards your Instance now goes through the Public Gateway. To access your Instance using SSH, first create a static NAT association between a port of your Public Gateway (eg 2222) and the private IP assigned to your Instance, on the SSH port (22 by default). Then, SSH to the Public Gateway's IP on port 2222. |
| 25 | +If DHCP **is** activated and your Public Gateway **is** set to advertise a default route, not being able to connect to your Instance via SSH is **expected behavior**. All the traffic towards your Instance now goes through the Public Gateway. |
| 26 | + |
| 27 | +To access your Instance using SSH, either: |
| 28 | +- Use [SSH bastion](/network/public-gateways/how-to/use-ssh-bastion/), or |
| 29 | +- Create a static NAT association between a port of your Public Gateway (eg 2222) and the private IP assigned to your Instance, on the SSH port (22 by default). Then, SSH to the Public Gateway's IP on port 2222. |
0 commit comments