[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to force ifup to wait for dhcp?



On Monday 21 July 2008 11:46, Mike Bird wrote:
> On Mon July 21 2008 01:32:45 Shachar Or wrote:
> > On Monday 21 July 2008 11:21, Mike Bird wrote:
> > > On Mon July 21 2008 01:15:43 Shachar Or wrote:
> > > > On Monday 21 July 2008 11:07, Mike Bird wrote:
> > > > > 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".
> > > >
> > > > Which ifup is that you're talking about? There are three ifups; one
> > > > for each interface you have.
> > >
> > > The ifup on wlan0, the only auto/dhcp interface.
> >
> > The ifup wlan0 command brings up that interface. Only after it is 'up',
> > it launches the dhcp client for that interface. How can you want have the
> > ifup command run after the dhcp client?
>
> Nobody has asked to have the ifup command run after the dhcp client.
>
> The ifup launches the dhcp client but the ifup doesn't wait for dhcp
> to succeed.  How does one make the ifup wait for the dhcp to succeed?

Ah, I understand. The openvpn init script runs after the networking init 
script and it depends on the success of the dhcp client which the networking 
script runs.

The problem is that the networking script runs the dhcp in the background 
finishes before it succeeds, allowing the openvnp init script to start 
prematurely.

So perhaps you can do something like:

 # Wifi
 auto wlan0
 iface wlan0 inet manual
         wireless-essid (omitted)
         wireless-key (omitted)
         wireless-ap any
         dns-nameservers 127.0.0.1
         dns-search yosemite.net
	 post-up "dhclient wlan0"

"The DHCP client will normally run in the foreground until it has configured 
an interface, and then will revert to running in the background."

This way the ifup script should wait for the dhcp to go to succeed and go to 
background, I think.

>
> For example, Google found a changelog entry from Ubuntu which suggests
> that Ubuntu's ifupdown waits for dhcp on eth0.  Can one configure ifup
> to wait for dhcp on wlan0, or do I have to patch the source?
>
> --Mike Bird

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


Reply to: