Answers: <p>I added routes in each of the subnets on both requestor and receiver side and it worked.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-05-03T13:58:08.550Z
Answers: 2022-05-03T13:58:08.550Z
Answers: Vizeet Srivastava
Body: <p>It's a very simple setup in which there are two EC2 instances each in a different region but under the same account. Both are peered.</p>
  <p>Requester EC2 EC2Virginia has the following details:</p>
  <pre><code>Public IP: 34.201.42.246
  Private IP: 172.30.3.42
  Subnet is in US-east-1a
  VPC CIDR: 172.30.0.0/16
  Allow requester VPC to resolve DNS of hosts in accepter VPC to private IP addresses is enabled for both requester and accepter.
  Route: Destination is 172.31.0.0/16 using peering connection
  Security group accepts all inbound and outbound traffic
  </code></pre>
  <p>Accepter EC2 EC2Ireland has the following details:</p>
  <pre><code>Public IP: 3.248.183.191
  Private IP: 172.31.28.244
  Subnet is in eu-west-1c
  VPC CIDR: 172.31.0.0/16
  Allow requester VPC to resolve DNS of hosts in accepter VPC to private IP addresses is enabled for both requester and accepter.
  Route: Destination is 172.30.0.0/16 using peering connection
  Security group accepts all inbound and outbound traffic
  </code></pre>
  <p>I am trying to do ssh from EC2Virginia to EC2Ireland and it is failing.</p>
  <pre><code>[ec2-user@ip-172-30-3-42 ~]$ ssh -i &quot;irelandconnect.pem&quot; ec2-user@172.31.28.244
  ssh: connect to host 172.31.28.244 port 22: Connection timed out
  </code></pre>
  <p>I executed following route command on EC2Virginia:</p>
  <pre><code>[ec2-user@ip-172-30-3-42 ~]$ routel
           target            gateway          source    proto    scope    dev tbl
          default         172.30.0.1                                     eth0 
  169.254.169.254                                                        eth0 
      172.30.0.0/ 20                     172.30.3.42   kernel     link   eth0 
        127.0.0.0          broadcast       127.0.0.1   kernel     link     lo local
       127.0.0.0/ 8            local       127.0.0.1   kernel     host     lo local
        127.0.0.1              local       127.0.0.1   kernel     host     lo local
  127.255.255.255          broadcast       127.0.0.1   kernel     link     lo local
       172.30.0.0          broadcast     172.30.3.42   kernel     link   eth0 local
      172.30.3.42              local     172.30.3.42   kernel     host   eth0 local
    172.30.15.255          broadcast     172.30.3.42   kernel     link   eth0 local
              ::/ 96     unreachable                                       lo 
  ::ffff:0.0.0.0/ 96     unreachable                                       lo 
      2002:a00::/ 24     unreachable                                       lo 
     2002:7f00::/ 24     unreachable                                       lo 
     2002:a9fe::/ 32     unreachable                                       lo 
     2002:ac10::/ 28     unreachable                                       lo 
     2002:c0a8::/ 32     unreachable                                       lo 
     2002:e000::/ 19     unreachable                                       lo 
     3ffe:ffff::/ 32     unreachable                                       lo 
          fe80::/ 64                                   kernel            eth0 
              ::1              local                   kernel              lo local
  fe80::5c:7dff:fea5:1d59              local                   kernel            eth0 local
        multicast                           
  </code></pre>
  <p>Please help resolve this issue.</p>
  
Comments: CC BY-SA 4.0
Comments: 2022-05-03T00:11:37.017Z
Comments: Did you update the route tables in each subnet on both the receiver and requester?
Comments: jordanm
Comments: CC BY-SA 4.0
Comments: 2022-05-03T13:14:22.613Z
Comments: Can you elaborate on the type of peering and how it's setup?
Comments: kenlukas
Tags: <amazon-web-services><amazon-ec2><aws-vpc>
Title: Unable to ssh into EC2 instance to the peered VPC which is in different region
UserDisplayName: Vizeet Srivastava
ThreadText: # Unable to ssh into EC2 instance to the peered VPC which is in different region
  
  (Asked by: username_0 on 2022-05-02)
  
  It's a very simple setup in which there are two EC2 instances each in a different region but under the same account. Both are peered.
  
  Requester EC2 EC2Virginia has the following details:
  
  ```
  Public IP: 34.201.42.246
  Private IP: 172.30.3.42
  Subnet is in US-east-1a
  VPC CIDR: 172.30.0.0/16
  Allow requester VPC to resolve DNS of hosts in accepter VPC to private IP addresses is enabled for both requester and accepter.
  Route: Destination is 172.31.0.0/16 using peering connection
  Security group accepts all inbound and outbound traffic
  
  ```
  
  Accepter EC2 EC2Ireland has the following details:
  
  ```
  Public IP: 3.248.183.191
  Private IP: 172.31.28.244
  Subnet is in eu-west-1c
  VPC CIDR: 172.31.0.0/16
  Allow requester VPC to resolve DNS of hosts in accepter VPC to private IP addresses is enabled for both requester and accepter.
  Route: Destination is 172.30.0.0/16 using peering connection
  Security group accepts all inbound and outbound traffic
  
  ```
  
  I am trying to do ssh from EC2Virginia to EC2Ireland and it is failing.
  
  ```
  [ec2-user@ip-172-30-3-42 ~]$ ssh -i "irelandconnect.pem" ec2-user@172.31.28.244
  ssh: connect to host 172.31.28.244 port 22: Connection timed out
  
  ```
  
  I executed following route command on EC2Virginia:
  
  ```
  [ec2-user@ip-172-30-3-42 ~]$ routel
           target            gateway          source    proto    scope    dev tbl
          default         172.30.0.1                                     eth0 
  169.254.169.254                                                        eth0 
      172.30.0.0/ 20                     172.30.3.42   kernel     link   eth0 
        127.0.0.0          broadcast       127.0.0.1   kernel     link     lo local
       127.0.0.0/ 8            local       127.0.0.1   kernel     host     lo local
        127.0.0.1              local       127.0.0.1   kernel     host     lo local
  127.255.255.255          broadcast       127.0.0.1   kernel     link     lo local
       172.30.0.0          broadcast     172.30.3.42   kernel     link   eth0 local
      172.30.3.42              local     172.30.3.42   kernel     host   eth0 local
    172.30.15.255          broadcast     172.30.3.42   kernel     link   eth0 local
              ::/ 96     unreachable                                       lo 
  ::ffff:0.0.0.0/ 96     unreachable                                       lo 
      2002:a00::/ 24     unreachable                                       lo 
     2002:7f00::/ 24     unreachable                                       lo 
     2002:a9fe::/ 32     unreachable                                       lo 
     2002:ac10::/ 28     unreachable                                       lo 
     2002:c0a8::/ 32     unreachable                                       lo 
     2002:e000::/ 19     unreachable                                       lo 
     3ffe:ffff::/ 32     unreachable                                       lo 
          fe80::/ 64                                   kernel            eth0 
              ::1              local                   kernel              lo local
  fe80::5c:7dff:fea5:1d59              local                   kernel            eth0 local
        multicast                           
  
  ```
  
  Please help resolve this issue.
  
  **Tags:** amazon-web-services, amazon-ec2, aws-vpc
  
  > **Comments:**
  > **username_1**: Did you update the route tables in each subnet on both the receiver and requester?  
  > **username_2**: Can you elaborate on the type of peering and how it's setup?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-05-03. Score: 0
  
  I added routes in each of the subnets on both requestor and receiver side and it worked.
  
  
  ---
  
  