Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Well this might be a simple networking question but a question that is puzzling me. I hope some one can clarify something for me. I have to physical computers, a linux laptop, and gaming computer (really up to date) that I dual boot win7 and ubuntu server. I then set up my apache, ssl, php, mysql on my server. I then changed /etc/hosts/ for my internal IP of my server to just be called for example :

Now.. I want to get my external IP in /etc/hosts so that I can connect with my laptop to my server (which will be on)

However I don't know if this is normal but I ran the command :


and I was given my external ip on my server which is i was happy and I used that to connect with my browser and it all works (this made me happy) now I tried the same command on my laptop and I was given the same IP:

how can two different computers (that I have tested network connectivity) both have the same IP?

And then my second question : why is it when I type in on my browser and it takes me to my server apache rather then my laptop apache?

On my router port forwarding I have enabled HTTPS for my servers internal IP and I have enabled 80 on my laptops internal IP.

Would love if some one can clarify this for me.

share|improve this question

migrated from Jan 6 '13 at 14:56

This question came from our site for system and network administrators.

What you are seeing is quite normal, and boils down to a technique called Network Address Translation or NAT. Basically, outgoing packets are rewritten by your router to have your ISP-assigned public IP address as the sender, and the router keeps a state table listing the rewrites it has done so that each response packet can be rewritten properly and then routed back to the correct computer.

If you check the IP address on each computer's network interface using e.g. the ifconfig command, you will see that they do indeed have different IP addresses on the "inside".

The above captures the basic elements of NAT; if you want more details, you may want to head on over to Wikipedia: Network Address Translation.

Normally, you would use the internal rather than the external IP address in /etc/hosts on hosts on the "inside" (local) network. That way, you don't have to worry about your ISP assigning you a new address.

share|improve this answer
Ah! Alright, I as guessing that since my table in my router indeed has my internals, 150 = for my win7 part (static) 6 = for my server, 3 = for my laptop. And for the /etc/hosts/ I need to have the external on so I can work on my server from school and test my web application. The internal won't be able to work. I have it as : as on my internal ip port 443 is the only open port inside the router. and on my laptop its a personal testing computer so I don't have 443 open. no need. Am I getting this right? – RaGe10940 Jan 6 '13 at 13:39
The format of /etc/hosts is simply <ip-addr> <hostname1> [hostname2 ... hostnameN] with a minimum of one host name assigned. (I'm not aware of any maximum limit, but there might be.) So it sounds like you have it mostly correct, at least. – Michael Kjörling Jan 6 '13 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .