Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a question.

I came across the following situation in a windows server ...

192.168.0.0 mask 255.255.0.0 GTW x . . .

192.168.3.0 mask 255.255.255.0 GTW y


By chance in this scenario there is any possibility of overlapping networks?

192.168.3.0/16 and 192.168.3.0/24 can coexist?

share|improve this question
    
Tecnnically, there's no network 192.168.3.0/16, because the netmask will wipe that .3. –  womble Aug 3 '11 at 8:07
    
...... Ok I just want to emphasize that this is not a hypothetical situation ... is a real situation ... Below is a screen print of the routing table of a server ... These IPs (overlapping) with different masks can not be located on the same Ethernet segment ... My question is, in this situation the server can identify the destination network and send the right packages? i.stack.imgur.com/j7sZG.jpg –  Alex Xisto Aug 4 '11 at 13:01

3 Answers 3

This isn't a situation I'd like, and the answer depends on your definition of "coexist".

There cannot be hosts with the same address, i.e. if host A has address 192.168.3.5/16 and host B has 192.168.3.5/24 and they will try to live on the same Ethernet segment, they'll cause IP address conflicts.

When you send a packet over IP network, you do not specify a subnet, only the IP address. Subnets are a tool for routing, so if A and B live on different Ethernet segments, only B will receive packets, because routers will choose the one with the longest mask.

Actually, about the only situation, where I would expect definition of both 192.168.0.0/16 and 192.168.x.0/24 to appear would be a routing table. I could imagine, that hosts on the /24 subnet are in separate place, and need special definition of routing. In that case it is a normal, acceptable thing. About any other is something weird, or at least I cannot think of a rational justification of such a config right now.

share|improve this answer
    
There's no such thing as IP address 192.168.3.5/24 -- it's just 192.168.3.5. I'm pretty sure the details given by the OP came out of a routing table -- where else would you get gateways? –  womble Aug 3 '11 at 8:05
    
@womble How do you propose to differentiate between 192.168.3.5 on 192.168.3.0/24 and 192.168.0.0/16 networks in this context? I think what I devised is readable, but if you can think of a better concise description I'll gladly learn. –  Paweł Brodacki Aug 3 '11 at 8:28
    
You don't; an IP address is an IP address. –  womble Aug 3 '11 at 8:34
    
Ok I just want to emphasize that this is not a hypothetical situation ... is a real situation ... Below is a screen print of the routing table of a server ... These IPs (overlapping) with different masks can not be located on the same Ethernet segment ... My question is, in this situation the server can identify the destination network and send the right packages? i.stack.imgur.com/j7sZG.jpg –  Alex Xisto Aug 4 '11 at 13:04
    
When determining a route for the packet the host will choose one with the longest subnet mask. I.e. if it has a packet to 192.168.3.X, it will always be sent via interface on 192.168.3.0/24 network, because it has longer netmask (i.e. it is more specific route) than 192.168.0.0/16. –  Paweł Brodacki Aug 5 '11 at 7:04

There's nothing "wrong" with what you're seeing. How this Windows Server machine connects to these two networks doesn't say anything about the hosts on each network communicate with other networks.

Consider:

  192.168.0.1/16             192.168.3.1/24
              v   _________   v
              v  |         |  v
              .--| Win Srv |--.
__________    |  |_________|  |    _________
|         |   |               |   |         |
|  host   |---|               |---|  host   |
|_________|   |               |   |_________|
              |               |
__________    |               |    _________
|         |   |               |   |         |
|  host   |---|               |---|  host   |
|_________|   |   _________   |   |_________|
              |  |         |  |
              |--| router  |--|
              ^  |_________|  ^
              ^       |       ^
192.168.0.254/16      |      192.168.3.254/24
                     ///

The hosts connected to each network are going to have their respective interface on this router specified as their default gateway. The Windows Server machine is going to have one or the other router interface's IP address specified as its default gateway.

You wouldn't want to assign IP addresses from the 192.168.3.0/24 network to hosts in the 192.168.0.0/16 network. Hosts on the 192.168.0.0/16 network are going to need a static route specified in their routing tables for the 192.168.3.0/24 network to allow them to communicate with hosts on the 192.168.3.0/24 network. This is inconvenient but by no means a "deal breaker".

Edit:

In the example above the Windows Server machine will deliver data to the right destination with no static routes needed. The server has entries in its routing table as a result of having interfaces local to each subnet. Of any of the boxes in the example scenario it will have the easiest time.

Your example (below) is a different animal than my example and different than your question:

You're talking about a server that has what would appear to be a static route to the 192.168.0.0/16 network via 192.168.9.2 and three static routes to a 192.168.6.0/24, 192.168.4.0/24, and 192.169.8.0/24 network accessible via a gateway at 192.169.1.254.

Without understanding more about the topology (IP addresses assigned to interfaces on the server, layout of the various networks behind the various routers in play) it's difficult to say much of anything. Certainly, there's nothing inherently "wrong" with anything I'm seeing in your image, except for the obvious and glaring fact that networks falling into 192.169.0.0/16 aren't RFC-1918 address space and shouldn't be used inside private networks.

share|improve this answer
    
Ok I just want to emphasize that this is not a hypothetical situation ... is a real situation ... Below is a screen print of the routing table of a server ... These IPs (overlapping) with different masks can not be located on the same Ethernet segment ... My question is, in this situation the server can identify the destination network and send the right packages? i.stack.imgur.com/j7sZG.jpg –  Alex Xisto Aug 4 '11 at 13:04
    
@Alex Xisto: I'm dropping on an edit. –  Evan Anderson Aug 4 '11 at 13:47

It's more than a "possibility" of overlapping networks, it's a fact. There's no problem, though, because IP routing is smart enough to route packets to the most-specific route available, which does the right thing for you.

share|improve this answer

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.