FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-21-2008, 06:24 AM
Mike Bird
 
Default How to force ifup to wait for dhcp?

How does one force ifup to wait for dhcp?

The Lenny laptops here start wlan0. AP authentication
and DHCP both occur independently in the background.
Up to half a minute elapses before AP authentication
has occured, DHCP has retried, and DHCP has succeeded.

By then, openvpn has gotten very confused by the absence
of a default route and networking/openvpn/quagga have to
be restarted manually in order to put the pieces back
together in the right order.

Do I really need a "post-up sleep 30" or is there a better
solution?

TIA,

--Mike Bird


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 06:44 AM
Andrei Popescu
 
Default How to force ifup to wait for dhcp?

On Sun,20.Jul.08, 23:24:23, Mike Bird wrote:
> How does one force ifup to wait for dhcp?
>
> The Lenny laptops here start wlan0. AP authentication
> and DHCP both occur independently in the background.
> Up to half a minute elapses before AP authentication
> has occured, DHCP has retried, and DHCP has succeeded.
>
> By then, openvpn has gotten very confused by the absence
> of a default route and networking/openvpn/quagga have to
> be restarted manually in order to put the pieces back
> together in the right order.
>
> Do I really need a "post-up sleep 30" or is there a better
> solution?

I think I'm missing something obvious, but how can DHCP succeed before
the AP authentication?

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)
 
Old 07-21-2008, 06:51 AM
Mike Bird
 
Default How to force ifup to wait for dhcp?

On Sun July 20 2008 23:44:55 Andrei Popescu wrote:
> I think I'm missing something obvious, but how can DHCP succeed before
> the AP authentication?

You're right, it can't. But if there's a way to make
DHCP wait for AP authentication I haven't found it.
Fortunately, DHCP retries a few times.

--Mike Bird


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 07:08 AM
Shachar Or
 
Default How to force ifup to wait for dhcp?

On Monday 21 July 2008 09:24, Mike Bird wrote:
> How does one force ifup to wait for dhcp?
>
> The Lenny laptops here start wlan0. AP authentication
> and DHCP both occur independently in the background.
> Up to half a minute elapses before AP authentication
> has occured, DHCP has retried, and DHCP has succeeded.
>
> By then, openvpn has gotten very confused by the absence
> of a default route and networking/openvpn/quagga have to
> be restarted manually in order to put the pieces back
> together in the right order.
>
> Do I really need a "post-up sleep 30" or is there a better
> solution?

Can you please attach your
/etc/network/interfaces
file?

>
> TIA,
>
> --Mike Bird

--
Shachar Or | שחר אור
http://ox.freeallweb.org/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 07:22 AM
Mike Bird
 
Default How to force ifup to wait for dhcp?

On Mon July 21 2008 00:08:48 Shachar Or wrote:
> Can you please attach your
> /etc/network/interfaces
> file?

Appended below.

--Mike Bird


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The wired network interface
# auto eth0
iface eth0 inet dhcp
dns-nameservers 127.0.0.1
dns-search yosemite.net

# Wifi
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid (omitted)
wireless-key (omitted)
wireless-ap any
dns-nameservers 127.0.0.1
dns-search yosemite.net

# Canonical IP
auto dummy0
iface dummy0 inet static
address (omitted)
netmask 255.255.255.255


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 07:28 AM
Andrei Popescu
 
Default How to force ifup to wait for dhcp?

On Sun,20.Jul.08, 23:51:56, Mike Bird wrote:
> On Sun July 20 2008 23:44:55 Andrei Popescu wrote:
> > I think I'm missing something obvious, but how can DHCP succeed before
> > the AP authentication?
>
> You're right, it can't. But if there's a way to make
> DHCP wait for AP authentication I haven't found it.
> Fortunately, DHCP retries a few times.

This sounds like a bug in ifupdown, as I thing DHCP should not be
started before the interface signals it has link up.

As to your original problem, I think a hackish fix would be to put a
'touch somefile' as post-up in interfaces file and then have the openvpn
script check for this file. I can't bet on it, but I think ifupdown
already creates such a file somewhere in /var/run.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)
 
Old 07-21-2008, 07:36 AM
Shachar Or
 
Default How to force ifup to wait for dhcp?

It would be more intelligent behaviour for the ifup script to wait with dhcp
for AP association. If it does not do this, as you say, please report a bug
against the ifupdown package.

Perhaps the file /etc/dhcp3/dhclient.conf can help you. In particular,
the 'retry' statement. Check the dhclient.conf(5) manual for that.

--
Shachar Or | שחר אור
http://ox.freeallweb.org/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 07:43 AM
Mike Bird
 
Default How to force ifup to wait for dhcp?

On Mon July 21 2008 00:36:28 Shachar Or wrote:
> It would be more intelligent behaviour for the ifup script to wait with
> dhcp for AP association. If it does not do this, as you say, please report
> a bug against the ifupdown package.
>
> Perhaps the file /etc/dhcp3/dhclient.conf can help you. In particular,
> the 'retry' statement. Check the dhclient.conf(5) manual for that.

DHCP does retry. It's not optimal but it kinda works. Sometime after
AP authentication we eventually get DHCP from one of the retries.

The problem is that I've not found a way to make startup wait for DHCP
before plowing ahead and making a mess of openvpn, which then messes up
the routing in quagga.

--Mike Bird


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 07:50 AM
Shachar Or
 
Default How to force ifup to wait for dhcp?

On Monday 21 July 2008 10:43, Mike Bird wrote:
> On Mon July 21 2008 00:36:28 Shachar Or wrote:
> > It would be more intelligent behaviour for the ifup script to wait with
> > dhcp for AP association. If it does not do this, as you say, please
> > report a bug against the ifupdown package.
> >
> > Perhaps the file /etc/dhcp3/dhclient.conf can help you. In particular,
> > the 'retry' statement. Check the dhclient.conf(5) manual for that.
>
> DHCP does retry. It's not optimal but it kinda works. Sometime after
> AP authentication we eventually get DHCP from one of the retries.

I am suggesting that you set the retry to a lower value so that it will retry
every minute or so, for example.
>
> The problem is that I've not found a way to make startup wait for DHCP
> before plowing ahead and making a mess of openvpn, which then messes up
> the routing in quagga.

Once dhcp fails/times-out the openvpn setup gets busted?

If this s true, then perhaps look at 'timeout' statement.

If non of this works, perhaps you can use a static address instead of dhcp?
>
> --Mike Bird

--
Shachar Or | שחר אור
http://ox.freeallweb.org/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 08:07 AM
Mike Bird
 
Default How to force ifup to wait for dhcp?

On Mon July 21 2008 00:50:39 Shachar Or wrote:
> On Monday 21 July 2008 10:43, Mike Bird wrote:
> > The problem is that I've not found a way to make startup wait for DHCP
> > before plowing ahead and making a mess of openvpn, which then messes up
> > the routing in quagga.
>
> Once dhcp fails/times-out the openvpn setup gets busted?

DHCP neither fails nor times out. DHCP occurs in the background. Openvpn
starts up before DHCP has succeeded. Of particular concern to openvpn is
that there is no default route until DHCP has succeeded.

The question is how to make ifup wait for DHCP on wlan0, so that the default
route is available when openvpn starts, as we need openvpn to create a route
with a next hop of "net_gateway".

--Mike Bird


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 07:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org