What is my Current External IP Address for all Environments

0

Hi There,

As part of our application we have a program which connected to an SFTP server and uploads a file, however I need to establish what my current IP Addresses are on my Application servers to get them Whitelisted to allow for the SFTP connection to be accepted, can you help me find out my external IP addresses for my environment please?

Thanks Rob

asked 9 months ago264 views
2 Answers
0

Hello.
Selecting My IP in the security group settings will set your global IP that you are currently using.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#adding-security-group-rule

Also, if you can run the "curl" command from a console, try the following command.
To check IPv4, add "-4" to the options.

curl ifconfig.io
curl ifconfig.io -4
profile picture
EXPERT
answered 9 months ago
  • Where can I find the MY IP Button ?

  • Thank you for your reply. When editing a security group rule, you can select it by "Source" as shown in the image below. test

  • sorry this is how I can get MY IP address on my machine, this is not what I am after. i am looking for the IP Address of the elastic beanstalk application server as this is the machine which is attempting to make the SFTP connection to an external source?

  • I understand. Is the Elastic Beanstalk EC2 instance deployed on a public subnet? For private subnets, is there a NAT Gateway or similar in place?
    If EC2 is deployed on a public subnet, you can check the public IP address from the EC2 instance screen. If you are using a NAT Gateway on a private subnet, you can check it from the VPC→NAT Gateway screen.

0

Are the application servers in private subnets where their outbound requests are routed through NAT Gateways? If so, the IP addresses you need is the Elastic IP of the NAT Gateways.

Otherwise, you can obtain the Public IPs of the application servers via the Console, AWS CLI, or EC2 Meta Data Service.

AWS CLI:

aws ec2 describe-instances --query Reservations[*].Instances[*].PublicIpAddress

Meta Data on the server:

TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/public-ipv4
profile pictureAWS
EXPERT
kentrad
answered 9 months ago
profile picture
EXPERT
reviewed 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions