why are my subnets not working as I think?

I have got a very basic network

ISP —> MIKROTIK —> SWITCH —> SERVERS

I will use 10.20.30.0 to 10.20.30.255 for my servers behind mikrotik

I want separate gateway and broadcast addresses for my servers so I will divide my 10.20.30.0/24 ip to several subnets.

I add my subnets to my mikrotik like that:

10.20.30.1/27 network: 10.20.30.0 broadcast: 10.20.30.31
10.20.30.32/28 network: 10.20.30.32 broadcast: 10.20.30.47
10.20.30.48/28 network: 10.20.30.48 broadcast: 10.20.30.63
10.20.30.64/29 network: 10.20.30.64 broadcast: 10.20.30.71

I configure my first server like that:
Server ip: 10.20.30.2
Gateway: 10.20.30.1
Broadcast:10.20.30.31
Netmask: 255.255.255.224

Second server:
Server ip: 10.20.30.33
Gateway: 10.20.30.32
Broadcast:10.20.30.47
Netmask: 255.255.255.240

Third Server:
Server ip: 10.20.30.49
Gateway: 10.20.30.48
Broadcast:10.20.30.63
Netmask: 255.255.255.240

Fourth Server:
Server ip: 10.20.30.65
Gateway: 10.20.30.64
Broadcast:10.20.30.71
Netmask: 255.255.255.248


everything looks perfect to me BUT not!

None of these servrs can connect to anywhere.
NO Connection no pinging nothing at all


Only IF I change netmasks to 255.255.255.0
I can connect and use this servers without any problem.

But I don’t understand what am I doing wrong?
Why can’t I use “correct” netmasks on my servers?
Why do I have to set all server netmasks to 255.255.255.0?
Is my understanding of subnetting completely wrong?

Please help me…

your gateways cannot be the subnet address:

Gateway: 10.20.30.1 ← this one is okay.
Gateway: 10.20.30.32 ← this is a subnet address, not a usable IP.
Gateway: 10.20.30.48 ← this is a subnet address, not a usable IP.
Gateway: 10.20.30.64 ← this is a subnet address, not a usable IP.

You also are missing the part where you add each of the subnets to the same interface on Mikrotik… Add .33, .49, and .65 to the Mikrotik (with appropriate /cidr) and then make the servers use an IP in their appropriate range. It’s a router, if there is a subnet the router has to have an IP address sitting in that subnet.

Sam

So correct me if I am wrong
I must add ips to mikrotik like that:

10.20.30.1/27 network: 10.20.30.0 broadcast: 10.20.30.31
10.20.30.33/28 network: 10.20.30.32 broadcast: 10.20.30.47
10.20.30.49/28 network: 10.20.30.48 broadcast: 10.20.30.63
10.20.30.65/29 network: 10.20.30.64 broadcast: 10.20.30.71

and then servers must be:

first server:
Server ip: 10.20.30.2
Gateway: 10.20.30.1
Broadcast:10.20.30.31
Netmask: 255.255.255.224

Second server:
Server ip: 10.20.30.34
Gateway: 10.20.30.33
Broadcast:10.20.30.47
Netmask: 255.255.255.240

Third Server:
Server ip: 10.20.30.50
Gateway: 10.20.30.49
Broadcast:10.20.30.63
Netmask: 255.255.255.240

Fourth Server:
Server ip: 10.20.30.66
Gateway: 10.20.30.65
Broadcast:10.20.30.71
Netmask: 255.255.255.248


By this way 3 Ips in each subnet can not be used ?
for example:
10.20.30.65/29
the first ip become my subnet address: 10.20.30.64 and i don’t have to add this ip to anywhere in mikrotik.
Second ip must be attached to mikrotik using cidr : 10.20.30.65/29
Server main ip address: 10.20.30.66
server can also use ips below:
10.20.30.67
10.20.30.68
10.20.30.69
10.20.30.70

And 10.20.30.71 becomes broadcast address and also can not be used.

3 ips will be wasted for each subnet

Is that right?

Greetings!

I would leave all subnets the same (10.20.30.0/24) and assign separate “subnets” with your dhcp servers, if that is your intention.

All gateways should be 10.20.30.1. And all interface subnets need to include that in the subnet range. Otherwise, the gateway will be unreachable.

I tested my own setup
and yes 3 ips wasted in my configuration for each subnet.
3 ips too much for me :slight_smile:
So I cancel all subnet stuff.
Will use default /24.

Yes, for each subnet you use (not waste?) 4 IPs. network address, 2 usable, and a broadcast address. If they are internal IPs you are not wasting them. You have as many as you could possibly need ; )

The downside to doing it this way is that every server has to talk thru the router to talk to another server, which is a lot of overhead if you are trying to copy files back and forth. There are good reasons to subnet, just need to make sure its necessary for what your trying to accomplish.

Sam