1

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.

2
  • 1
    Did you update the route tables in each subnet on both the receiver and requester?
    – jordanm
    May 3 at 0:11
  • Can you elaborate on the type of peering and how it's setup?
    – kenlukas
    May 3 at 13:14

1 Answer 1

0

I added routes in each of the subnets on both requestor and receiver side and it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.