-1

I'm still learning the ropes of Windows Server (specifically 2012R2).

My assigned task is to setup a static local IP address, I managed to get it set to 192.168.1.96 (with subnet mask 255.255.255.0)

However they need the ip to be on 192.168.2.96, but when I try I get: Warning - The default gateway is not on the same network segment (subnet) that is defined by the IP address and subnet mask.

Using 255.255.0.0 is not an option, so how else would I do this?

Details you might need:

  • I'm using Windows Server 2012 R2 inside a Virtual Machine (like i said this is just for training purposes)
Rex
  • 7,895
  • 3
  • 29
  • 45
Gaza
  • 215
  • 2
  • 12
  • 1
    What is your gateway IP address? I mean, the *real* IP address of your gateway, not the one you configured on the windows machine. – shodanshok Jul 24 '15 at 11:04
  • Gateway is 192.168.1.120 – Gaza Jul 24 '15 at 11:06
  • 1
    So you have a /23 then? in that case 255.255.254.0 should work, if not they've given you bad info – Chopper3 Jul 24 '15 at 11:25
  • 4
    @Chopper3: With a 23-bit subnet mask, 192.168.0.0 and 192.168.2.0 are both network address (third octets ending in 00 and 10 respectively), which means 192.168.2.96 and 192.168.1.120 would still be on different subnets. The correct subnet mask to put these two on the same subnet is a 22-bit mask, or 255.255.252.0. You could use a 23-bit mask with 192.168.0.x and 192.168.1.x, which is not quite what the OP has. – Todd Wilcox Jul 24 '15 at 12:15
  • 1
    Yeah you're right Todd, answered too quickly - good call – Chopper3 Jul 24 '15 at 12:17
  • 3
    @Gaza - Scottish Borders Design - There's information missing here. Somebody isn't giving you the entire story. If 192.168.2.96 is the correct ip address and if 192.168.1.120 is the correct Default Gateway ip address then a subnet mask of 255.255.252.0 would work without question. Additionally, this question has nothing to do with Windows Server. This question is about networking and subnetting and would be relevant to any host on your network, Windows or otherwise. – joeqwerty Jul 24 '15 at 14:47

2 Answers2

5

So your gateway IP is 192.168.1.120.

What is its subnet mask?

If it is 255.255.255.0, in no way you can use a 192.168.2.x IP and hope that it works. Client IP and network gateway must be on the same network, and this is the very same reason Windows is getting you an error.

EDIT: maybe you can assign two IP addresses on you Windows machine, 192.168.1.96/24 with gateway 192.168.1.120, and 192.168.2.96/24 without any gateway

shodanshok
  • 47,711
  • 7
  • 111
  • 180
  • yes i know this, it was explained in the question, your just telling me what i already know! – Gaza Jul 24 '15 at 11:18
  • 3
    Then you already know the answer: the configuration they told you to make is invalid and will not work (unless you add a new subnet, put a default gateway on it and set up routing. This seems to be beyond your skill level though) – Sander Steffann Jul 24 '15 at 11:38
  • @Gaza-ScottishBordersDesign: I've edited my answer, give it a look. – shodanshok Jul 24 '15 at 12:58
  • @shodanshok the second IP address wil cause problems because other systems won't be able to reply to it as there is no route – Sander Steffann Jul 24 '15 at 15:12
  • @SanderSteffann: it depends on its network setup. If all the other network nodes are on 192.168.1.x subnet, it will have no problem. Anyway, we are a little short of information... – shodanshok Jul 24 '15 at 16:00
1

I guess the gateway is something like 192.168.1.X since it worked while the server was in that range?

Then you need another subnet mask, the smallest mask to be usable here that has both the server and its gateway in the same network ist 255.255.252.0.

But the networks also needs to be configured in a way that allows that mask to be used. You should check with your network operators what kind of subnet mask is configured for the network you are to configure. It also might be possible that you need another gateway in 192.168.2.X.

dadriel
  • 106
  • 5
  • Hi, Gateway is 192.168.1.X. I've just tried 255.255.252.0 and it doesnt work, no network connection. I was told that i could do some kind of routing? No idea how to though – Gaza Jul 24 '15 at 10:56
  • As the others said, you can configure two IPs on the machine and then configure your windows to route between those, but that is a lot more advanced than your initial problem. And then your server woulde basicly become the gateway for the 192.168.2.x network to the rest of world. – dadriel Jul 24 '15 at 13:09