LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Load Balancing with Dynamic IPs (https://www.linuxquestions.org/questions/linux-server-73/load-balancing-with-dynamic-ips-732808/)

swordphsh 06-14-2009 02:23 AM

Load Balancing with Dynamic IPs
 
I'm looking for a way to do something similar to the iproute2 (manual section 4.2. Routing for multiple uplinks/providers) load balancing, but with dynamic IPs. I'm using two cable modems.
I have been looking around, but everything seems to be geared towards static addresses, but this is not an option for me.

Any help is appreciated, thanks in advance.

rweaver 06-15-2009 01:19 PM

Quote:

Originally Posted by swordphsh (Post 3573235)
I'm looking for a way to do something similar to the iproute2 (manual section 4.2. Routing for multiple uplinks/providers) load balancing, but with dynamic IPs. I'm using two cable modems.
I have been looking around, but everything seems to be geared towards static addresses, but this is not an option for me.

Any help is appreciated, thanks in advance.

There is no good way to perform this unless you reconfigure and restart the load balancing each time an ip address changes.

manwichmakesameal 06-15-2009 03:02 PM

Don't know about your isp, but mine NEVER changes my ip. They are given out according to the CPE mac address, so if you don't change your mac address on your router or whatever you have behind the modem, you could probably set it up like a static. You could throw in some error checking so IF your ip changes, you can just restart the load balancing.

swordphsh 06-15-2009 08:25 PM

Quote:

Originally Posted by manwichmakesameal (Post 3574932)
You could throw in some error checking so IF your ip changes, you can just restart the load balancing.

That could work. Do you have any suggestions on how to do that?

manwichmakesameal 06-15-2009 08:34 PM

Take a look at here. It's actually niels.horn's site. Specifically:
Code:

# Get IP addresses of our devices:
ip1=`ifconfig $DEV1 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'`
ip2=`ifconfig $DEV2 | grep inet | awk '{ print $2 }' | awk -F: '{ print $2 }'`

You could modify that into some sort of script to check if it has changed, then restart whatever load balancing services you need.


All times are GMT -5. The time now is 11:59 PM.