質問

I am looking to get the IP of my dev server. Everything online says to either do ifconfig or to curl something like whatismyip. These are giving me 2 different addresses. Why?

To add: I have no idea if it's behind a router or anything. I simply have an IP that I SSH into. I assumed that address was the address of the server - but when I curl http://ifconfig.me/ I get a completely different address.

Disclaimer: I have close to 0 networking knowledge.

役に立ちましたか?

解決

You are most likely behind a router that does network address translation. Your ifconfig could be showing an IP address from a private range, such as 192.168.xxx.xxx.

An alternative is that your development server has several network interfaces, in which case ifconfig should be showing you several (such as eth0, eth1). However, I have the feeling it's the first, because you didn't mention this.

You could possibly check for the former with a tool such as tracepath, thereby discovering the nodes in between your development server and the other servers. But it might just be easier to check with the IT administrator(s) for your development server.

他のヒント

Well if you're behind a router that could be one reason.

If your dev server is externally facing it's entirely possible that the DNS server that whatismyip is using has a different IP entry than the DNS server ifconfig.me is using.

try running tracert www.yahoo.com from the command line and see what IPs shows up in the results.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top