0

I have a application server (LAMP Stack) access. But php application connect to mysql from another db server. I have only private IP for this DB Server. Is their are any way to know public IP Address for this private IP address.

As this server is part of a AWS infrastructure, So by judging other servers, i am quite sure, that DB Server should have Public IP too.

I also checked with AWS Admin Panel, But their no private IP like this DB Server registered.

kuldeep.kamboj
  • 183
  • 1
  • 2
  • 9
  • 1
    Exactly what are you trying to do? If both of these servers are within AWS, then you probably do NOT want to use the public IP address. – Michael Hampton Dec 31 '13 at 08:15
  • I need to access that server for information gathering for future migration perspective, I already have some common user access details which I plan to try against that server when public ip will be known. – kuldeep.kamboj Dec 31 '13 at 08:57

2 Answers2

2

A few possible ways:

  1. Look at the output of ifconfig to see if a public IP address is listed.
  2. See if you've been given a public hostname that you can resolve to a public IP address.
  3. Run curl icanhazip.com on the server, to get back your public IP address (or use other similar services).
  4. Ask the hosting provider.
Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
  • First approach requires to have a ssh, Alas Its is MySQL Server So second approach not works here, For whatismyip.com, I do not think they will work for private IPs. – kuldeep.kamboj Dec 31 '13 at 10:26
  • Problem fixed. DB server is a RDS Instance and When I tried ping on all my RDS URL one-by-one from one of applications server, It give private IP same as required for one of RDS. As AWS Panel did not have information about Private IPs for RDS it taken so long to resolve issue. – kuldeep.kamboj Dec 31 '13 at 13:55
  • 1
    `curl icanhazip.com` is the best version of option 3. above. Using curl means not having to install X and a browser. The response from that site is nothing but the IP address. No need to grep through html. It's run by Major Hayden of MySQLTuner and Racker Hacker fame. – Ladadadada Jan 07 '14 at 17:55
  • Nice. I edited my answer to use that instead. – Andrew Schulman Jan 07 '14 at 20:21
0

I had the same issue with GoDaddy, needed to access the DB from public internet, and they provide me with a hostname that I can use from public internet. I agree with other answer, ask the provider for public access to the DB.

aseaudi
  • 256
  • 1
  • 5