Multiple ranges on the same server

bjseiler

Verified User
Joined
Jun 19, 2003
Messages
182
My data center is pretty stingy with ip addresses and now after some time, we've hit a small snag. I'm definitely not a networking expert so this is probably something stupid. We are not doing any routing and just have a managed switch that is handling 3 different ip subnets. Data center gives us one feed, it passes through the firewall to the switch, and then all the servers connect to that one switch.

We figured out that we can put multiple ip ranges on the same server. For example, we set up DA with IP 215.5.5.5 but then eventually add other ip's to the server like 215.5.5.6 but then also something like 66.5.5.5. This seems to work, which actually surprised me when I tried it the first time. And all traffic coming in/out of the data center has no problems.

Problem though.

Server A with original DA IP or 215.5.5.5 that also has 215.5.5.10 on it.

Server B with original DA IP of 66.5.5.5 that also has 215.5.5.20 on it.

If Server A tries to communicate with IP 215.5.5.20 on Server B, it can't.

Maybe I never should have tried this in the first place, but now that I did, I'm wondering if there is any way to fix it.
 
It sounds like you have your subnets mashed up. Having the real IPs would help.
 
Subnet 66.71.224.97/27
Subnet Mask 255.255.255.224


Subnet 216.55.79.96/27
Subnet Mask 255.255.255.224
 
I wonder if I'm the only person (stupid enough) to put different ip ranges on the same server........
 
You can have multiple ranges on the same server as long as your Linux/Unix stack supports it. Linux supports it and I presume FreeBSD does as well. Don't forget that no matter what IP# people use to access your server, responses generally come from the server's main IP#; if they're on different ranges, then possibly your firewalling doesn't like that.

Jeff
 
I have also had to set up other gateways on the same server to make traffic go out through different routers because of having different providers.

If you need help with that let me know.
 
I'll keep your offer in mind, and hope I never need it, since we use the BGP (bordergate protocol) provided by our network provider.

Jeff
 
I don't need it anymore either but here is the code anyway in case anybody does need it including me in the future.

Code:
#
ip route show table main | grep -Ev ^default | while read ROUTE ; do ip route add table 2 $ROUTE

done

ip route add default via 192.168.1.1 table 2
ip rule add from 192.168.1.0/24 table 2

This will force the network 192.168.1.0 to use the gateway 192.168.1.1 even if it is not the default gateway.

It has to be run each time the network is started.
 
Back
Top