amazon ec2 - SSH into EC2 binding to private IP, not public IP -


i've got ec2 instance has been set access secure server via vpn. second server respond calls bound ec2 server's public ip address.

i'm using ssh access ec2 instance laptop...

ssh -i mypem.pem ubuntu@ec2-my-public-ip-address.eu-west-1.compute.amazonaws.com 

but command line sets as:

ubuntu@my-private-ip-address:~$  

so, when try , run piece of java code on ec2 server, makes call secure server via vpn failing because using private ip address identifier. java code can't provided here, because secure service, has been extensively tested other examples , on ec2 , know there isn't problem here.

i'm trying see if there's way ensure code execute ec2 server uses public ip address rather private ip address possible?

the private ip address ip address ec2 instance knows about.

the public ip address translated to/from private ip ec2 network infrastructure using automatic static nat, instance never aware of it.

check ifconfig , notice public ip seen.

yet, if $ curl ipv4.icanhazip.com (or other "what ip?" service), you'll find instance's public ip address returned address seen external service.

using private ip internally automatically causes public ip address used when access internet.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -