IP address in LAN [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question(1) What is my and others real IP address on same lan? Can we still have a unique IP despite the fact that we share the same router/LAN? and how does the IPs are assigned?
Thanks!
If you use a router to access the internet you probably have a DHCP Server running on the router as well. This gives each computer a unique IP address wit a lease of x-days.
From the net only your public (mostly dynamic) ip address is shown to others.
Inside you private local net you have private ip addresses like 192.168.x.x/class C.
Easy way to find out your ip addess on your local computer: open a cmd shell and type "ipconfig /all". Then you see your IP address and also the gateway (which is your router).
Within a single LAN (which I'm defining here as a section of the net with no network address translation (NAT)), your IP address should be unique.
That's so that traffic can get to the correct machine.
However, it's never that simple. There's a good chance that the IP address the world sees you at is nothing like your local IP address. Your local address is probably 10.x.x.x or 192.x.x.x (from memory), one of a group of private IP ranges. For example, my Ubuntu box here is 10.1.1.2, an address that probably half a million other people on the planet have.
But my packets don't hit the internet with that source address since they go through a NAT router on my desk as well as a large number of other NAT'ting devices in my ISP.
It's this NAT process that allows all those private IP ranges to be usable.
As to how you get your IP addreses, you can set up static addresses (very useful for servers that you don't want changing) but the usual approach for non-server machines is to use a DHCP (dynamic host configuration protocol) server which manages the IP addresses and hands them out as required (on booting your client machine usually).
Typically, the DHCP server wil lock an IP address to a specific Ethernet MAC address for a period of time (in our corporate environment, it's three weeks). That means that, barring a four week holiday with your machine turned off, you should always have the same address.
Keep in mind that you may have more than one network card with separate IP addreses. You may even have a single network card with multiple IP addresses. In that case, you can be said to have more than one real IP address although I'd probably still say that it's the one servicing your default route (the source address your packets go out on by default).
It's a very ... interesting ... field to work in :-)
精彩评论