I have some servers on the public network of my isp, say 192.168.2.0/24
. Now my provider gives me additional ip addresses, but unfortunately not in a subsequent range of my first network, say 192.168.4.0/24
. I configure the new servers with the new ip range and now they communicate over the default gateway between the subnets, although they are on the same physical network. I add a route to the second network on each server, so they can send packets directly to each other. But if I look in ifconfig, of course I still see only one configured subnet.
Are there any downsides of this configuration? What is the difference to the case where I had the consecutive networks 192.168.2.0/24
and 192.168.3.0/24
and could just configure all interfaces in ifconfig with 192.168.2.0/23
and avoid the extra route?
I could imagine broadcast behavior is maybe different. If i broadcast a network it would only go to half of my servers in one subnet.
Additions:
As I read the first answers, I think my question was maybe no clear enough. The servers are all supposed to be on the public network, I do not want to hide them behind some router. They all also have an internal network connection where most traffic is going over. I was just wondering how you would configure multiple subnets on the same network interface and what the difference is between a setup with consecutive subnets and one with non-consecutive subnets. For me the servers are all in the same public network. It is just that the IP assignment of my provider and the configuration options I see in Linux do not really allow me to configure the servers as such. I have to make the separation between both subnets. I can add additional routes, but will it be the same as if I had one consecutive IP range for all servers?