Author Topic: balance traffic on dhcp gateway  (Read 1703 times)

wessel

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
balance traffic on dhcp gateway
« on: June 26, 2008, 09:56:20 am »
Hi,
I have a business sdsl line and a consumer cable line which I want to balance traffic on. But if I configure the consumer cable line with a static ip address (which was given to me when I had dhcp enabled first) this connection drops after a while. (ebox 0.11.101)

I have the feeling that my cable provider drops the connection in someway if there is no dhcp client listening. Or is that not possible?

But if I configure my line for dhcp I cannot configure a gateway because ebox restricts that (which does make sense of course, but just a 'are u sure' would have been better in my case)

I'm now considering of configuring it as static in ebox, and modify that after each restart/reload of ebox manually on the commandline to make a dhcp client listening. At least I can find out if my connection drops this way also (although it used to be stable when it was our only line)

Or are there better ways to solve/debug this?


sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: balance traffic on dhcp gateway
« Reply #1 on: June 27, 2008, 09:38:31 am »
It's completely possible that your provider drops your connection if there is not DHCP requests from your line.

Regarding to your question, if you're going to use a dhcp client, it may override your network configuration anyhow and anytime. There is dhcp clients which executes arbitrary scripts when they obtain a lease. [1]

[1] udhcpc: apt-get install udhcpc
My secret is my silence...

wessel

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: balance traffic on dhcp gateway
« Reply #2 on: June 27, 2008, 10:41:23 am »
thanks!  I'm running the dhclient3 process on the background now, and it works perfect. But with the one you mentioned I can let it send notification if providers changes address and I need to modify my ebox config. (maybe ebox should have an API so that I configure it from remote scripts ;-)

btw: I now use ebox in production, and it works great! Good thing is that it's completely ubuntu packages based, so I can find/ add everything I need.

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: balance traffic on dhcp gateway
« Reply #3 on: June 27, 2008, 02:54:59 pm »
thanks!  I'm running the dhclient3 process on the background now, and it works perfect. But with the one you mentioned I can let it send notification if providers changes address and I need to modify my ebox config. (maybe ebox should have an API so that I configure it from remote scripts ;-)
dhclient3 also allows to run scripts after getting a lease, etc. Indeed eBox is completely scriptable since it's written in Perl. If you know Perl, every eBox module has a public API to work with. For example, Network module allows to change the IP address as desired. Come to my mind this script (NOT TESTED at all) runned as root:

Code: [Select]
#!/usr/bin/perl

use EBox;
use EBox::Global;

EBox::init();
my $global = EBox::Global->getInstance();
my $network = $global->modInstance('network');
my $external = 0;
my $force = 1;
# Check network module API in /usr/share/perl5/EBox/Network.pm
$network->setIfaceStatic('eth0', '10.1.1.1', '255.0.0.0', $external, $force);
$global->saveAllModules();

Quote
btw: I now use ebox in production, and it works great! Good thing is that it's completely ubuntu packages based, so I can find/ add everything I need.
My secret is my silence...

wessel

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: balance traffic on dhcp gateway
« Reply #4 on: June 29, 2008, 09:41:26 pm »
It's getting better and better ;-)

I will have to refresh my perl memory, and read your developers guides.

Thanks. Wessel