Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I go into TCP/IP settings to manually set an IP address for an XP machine, what should be set for:

  • Subnet mask
  • Default gateway

What would happen if I set an IP address that is already assigned to another machine?

If I set a machine to be a certain IP number, will the DHCP server know not to try to give that IP address to another machine that joins the network?

share|improve this question
add comment

3 Answers

To answer your question, you first have to understand how IP addresses are allocated. (Note that this is a overly simplified version intended to be understandable with little background knowledge, and is not very technically accurate)

For example, if you are using private address space: 192.168.1.0 to 192.168.1.255:

192.168.1.0 represents the network
192.168.1.255 represents the broadcast address

192.168.1.1 to 192.168.1.254 are usable addresses for computers

Quite often, 192.168.1.1 represents the router, and thus, you have 192.168.1.2 to 192.168.1.254 on your disposal.

In this case, you have:

network 192.168.1.0
netmask 255.255.255.0
default gateway 192.168.1.1

the netmask, [11111111].[11111111].[11111111].[00000000] (when expanded in binary), indicates that in an arbitary address, no matter what you put in the '0' part, you are still within your network provided that the '1' part is equal.

Thus, 192.168.1.24 is in the network 192.168.1.0/255.255.255.0 whereas 192.168.2.24 is not.

In a home router network connected to an ADSL modem, the usual default gateway is the router itself, and the network mask is usually 255.255.255.0 (i.e. a class C network). Some routers do use 10.0.0.0/255.255.255.0 though.

In a leased line environment, usually you will be assigned, e.g. 4 address (one router, one broadcast and 2 usable), from, let's say, 123.123.123.4 - 123.123.123.7, then the default gateway is usually 123.123.123.4, and netmask 255.255.255.252 (i.e. 255.255.255.[11111100]) and broadcast 123.123.123.7.

share|improve this answer
    
Depending on implementation, most DHCP server I have used do not have that IP-conflict prevention capability. The safe bet is to limit the DHCP server to e.g. x.x.x.100-x.x.x.128, and use x.x.x.1-99 for static IPs. –  bubu Jun 24 '10 at 13:10
    
all the DHCP implementations I've used have had the ability to configure particular hosts to have a fixed IP without having to manually allocate, or reserve address range(s) –  Rowland Shaw Jun 24 '10 at 13:54
    
@Rowland Shaw I thought the OP asked if the DHCP implementations would allow for detection of current IPs on the network and not allocating these IP out on DHCP request. –  bubu Jun 24 '10 at 15:43
    
Seems I missed that edit -- I'll crawl back under my rock :) –  Rowland Shaw Jun 24 '10 at 16:15
add comment

If you are going to have a mixed DHCP/Static network, you want to make sure that your DHCP server has a limited number of IPs to assign. For example, on my home network, I assign static address to all wired connections, but use DHCP for all wireless connections. I can configure the DHCP server in my gateway router to assign address in the X.X.X.110 to X.X.X.120 range. Since I know what IP range my DHCP server is using, I just assign static IPs from the rest of the pool.

As to assigning an IP already in use to another system, whichever system is first to acquire the network will have use of the IP. Your system configured for DHCP MAY try to request a new IP, but unlikely if it is first onto the network.

As to assigning IPs at random, the only way your DHCP will know not to assign an IP already in use is if the system using that IP is alive on the network. The DHCP will see that and assign another from the avaiable pool.

share|improve this answer
add comment

Which networks are you going to connect to?

If it is a home router/ADSL device, it usually has DHCP configured but default.
So, you need to do nothing.

Here is a link to some basics on static IP configuration.
You can start from the Home-Network-help homepage if you need to get broader details.

Update on your extra question:
If you choose to use a static IP address, it should be outside the range used by your DHCP server. The server will not know about this allocation because normally, once you setup a static IP on this machine, it will not interact over DHCP with that server.

share|improve this answer
    
See my extra question. –  CJ7 Jun 24 '10 at 12:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.