public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] net.eth0 and net.eth1 choice + net.eth1 timeout
@ 2006-02-17  8:29 Marco Calviani
  2006-02-17  8:46 ` Heinz Sporn
  0 siblings, 1 reply; 8+ messages in thread
From: Marco Calviani @ 2006-02-17  8:29 UTC (permalink / raw
  To: gentoo-user

Hi list,
   i would like to share a problem that i'm encountering in dealing
with two net interfaces. I've a "normal" ethernet device (eth0) and a
wireless ipw2200 one (eth1).

1) i would like to have, at boot, a situation in which first of all
eth0 is started; if dhcp signal is found proceed with the
initialization of eth0, while if dhcp is not found try to start eth1.

2) as of now, at boot time i've only eth0; obviously if it's not
connected via ethernet cable the dhcp goes in timeout and net
initialization is failed. Then at the prompt i reissue
/etc/init.d/net.eth1 start to start wireless connection. However, and
here's the problem, the first time i digit this, eth1 goes in timeout
too. Digiting another time the same command and everythig goes well.
This situation is encountered everytime.

Thanks in advance for any hint,
MC

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] net.eth0 and net.eth1 choice + net.eth1 timeout
  2006-02-17  8:29 [gentoo-user] net.eth0 and net.eth1 choice + net.eth1 timeout Marco Calviani
@ 2006-02-17  8:46 ` Heinz Sporn
  2006-02-17  9:04   ` Marco Calviani
  2006-02-17  9:46   ` Neil Bothwick
  0 siblings, 2 replies; 8+ messages in thread
From: Heinz Sporn @ 2006-02-17  8:46 UTC (permalink / raw
  To: gentoo-user

Am Freitag, den 17.02.2006, 09:29 +0100 schrieb Marco Calviani:
> Hi list,
>    i would like to share a problem that i'm encountering in dealing
> with two net interfaces. I've a "normal" ethernet device (eth0) and a
> wireless ipw2200 one (eth1).
> 
> 1) i would like to have, at boot, a situation in which first of all
> eth0 is started; if dhcp signal is found proceed with the
> initialization of eth0, while if dhcp is not found try to start eth1.
> 

Have you looked into sys-apps/ifplugd ?

> 2) as of now, at boot time i've only eth0; obviously if it's not
> connected via ethernet cable the dhcp goes in timeout and net
> initialization is failed. Then at the prompt i reissue
> /etc/init.d/net.eth1 start to start wireless connection. However, and
> here's the problem, the first time i digit this, eth1 goes in timeout
> too. Digiting another time the same command and everythig goes well.
> This situation is encountered everytime.
> 
> Thanks in advance for any hint,
> MC
> 

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] net.eth0 and net.eth1 choice + net.eth1 timeout
  2006-02-17  8:46 ` Heinz Sporn
@ 2006-02-17  9:04   ` Marco Calviani
  2006-02-17  9:46   ` Neil Bothwick
  1 sibling, 0 replies; 8+ messages in thread
From: Marco Calviani @ 2006-02-17  9:04 UTC (permalink / raw
  To: gentoo-user

Hi Heinz,
   thanks for this hint i will try it. Question number 1) seems ok...........

Regards,
MC

2006/2/17, Heinz Sporn <heinz.sporn@sporn-it.com>:
> Am Freitag, den 17.02.2006, 09:29 +0100 schrieb Marco Calviani:
> > Hi list,
> >    i would like to share a problem that i'm encountering in dealing
> > with two net interfaces. I've a "normal" ethernet device (eth0) and a
> > wireless ipw2200 one (eth1).
> >
> > 1) i would like to have, at boot, a situation in which first of all
> > eth0 is started; if dhcp signal is found proceed with the
> > initialization of eth0, while if dhcp is not found try to start eth1.
> >
>
> Have you looked into sys-apps/ifplugd ?
>
> > 2) as of now, at boot time i've only eth0; obviously if it's not
> > connected via ethernet cable the dhcp goes in timeout and net
> > initialization is failed. Then at the prompt i reissue
> > /etc/init.d/net.eth1 start to start wireless connection. However, and
> > here's the problem, the first time i digit this, eth1 goes in timeout
> > too. Digiting another time the same command and everythig goes well.
> > This situation is encountered everytime.
> >
> > Thanks in advance for any hint,
> > MC
> >
>
> --
> gentoo-user@gentoo.org mailing list
>
>

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] net.eth0 and net.eth1 choice + net.eth1 timeout
  2006-02-17  8:46 ` Heinz Sporn
  2006-02-17  9:04   ` Marco Calviani
@ 2006-02-17  9:46   ` Neil Bothwick
  2006-02-17 13:56     ` [gentoo-user] " Thomas Kirchner
  1 sibling, 1 reply; 8+ messages in thread
From: Neil Bothwick @ 2006-02-17  9:46 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

On Fri, 17 Feb 2006 09:46:32 +0100, Heinz Sporn wrote:

> Have you looked into sys-apps/ifplugd ?

Note that the latest baselayout supports ifplugd itself. You only need to
emerge ifplugd, you don't need to configure it or add it to a runlevel.


-- 
Neil Bothwick

If at first you don't suceed, try the switch marked "Power"

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [gentoo-user] Re: net.eth0 and net.eth1 choice + net.eth1 timeout
  2006-02-17  9:46   ` Neil Bothwick
@ 2006-02-17 13:56     ` Thomas Kirchner
  2006-02-17 16:16       ` Neil Bothwick
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Kirchner @ 2006-02-17 13:56 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

* On Feb 17  9:46, Neil Bothwick (gentoo-user@lists.gentoo.org) wrote:
> Note that the latest baselayout supports ifplugd itself. You only need 
> to emerge ifplugd, you don't need to configure it or add it to a 
> runlevel.

I'm having a similar problem, and I'm using ifplugd via baselayout.  
(net.eth0 and net.eth1 starting by default runlevel, not ifplugd.)

However, when I start my laptop, only net.eth0 is started even if a 
wireless signal exists.  Obviously, I'd like net.eth1 (wireless) started 
if net.eth0 fails.

In /etc/conf.d/net, I've tried both the wpa_supplicant and iwconfig 
modules for eth1, with the ifplugd module, and nothing is attempted 
automatically.  I have to either manually iwconfig eth1 or restart 
/etc/init.d/net.eth1 to get a connection.

Any ideas why it's not starting automatically?

Tom

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Re: net.eth0 and net.eth1 choice + net.eth1 timeout
  2006-02-17 13:56     ` [gentoo-user] " Thomas Kirchner
@ 2006-02-17 16:16       ` Neil Bothwick
  2006-02-18 19:58         ` [gentoo-user] " Thomas Kirchner
  0 siblings, 1 reply; 8+ messages in thread
From: Neil Bothwick @ 2006-02-17 16:16 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

On Fri, 17 Feb 2006 08:56:23 -0500, Thomas Kirchner wrote:

> I'm having a similar problem, and I'm using ifplugd via baselayout.  
> (net.eth0 and net.eth1 starting by default runlevel, not ifplugd.)
> 
> However, when I start my laptop, only net.eth0 is started even if a 
> wireless signal exists.  Obviously, I'd like net.eth1 (wireless)
> started if net.eth0 fails.

net.eth0 isn't actually failing when ifplugd detects no cable. It is
shown as inactive rather than stopped. You could try starting the
interface from /etc/conf.d/local only if eth0 is not active with

etc/init.d/net.eth0 status --quiet | echo /etc/init.d/eth1 start

You should also edit /etc/conf.d/net to shut down eth1 when eth0 detects
a cable. I have this as the preup function

preup() {
  [ ${IFACE} == "eth0" ] && /etc/init.d/net.eth1 --quiet status && /etc/init.d/net.eth1 pause
  return 0
}


-- 
Neil Bothwick

"Bother," said Pooh, as he pulled the alien face-hugger off.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [gentoo-user] Re: Re: net.eth0 and net.eth1 choice + net.eth1 timeout
  2006-02-17 16:16       ` Neil Bothwick
@ 2006-02-18 19:58         ` Thomas Kirchner
  2006-02-18 23:34           ` Neil Bothwick
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Kirchner @ 2006-02-18 19:58 UTC (permalink / raw
  To: gentoo-user

* On Feb 17 16:16, Neil Bothwick (gentoo-user@lists.gentoo.org) wrote:
> net.eth0 isn't actually failing when ifplugd detects no cable. It is
> shown as inactive rather than stopped. You could try starting the
> interface from /etc/conf.d/local only if eth0 is not active with
> 
> etc/init.d/net.eth0 status --quiet | echo /etc/init.d/eth1 start

I meant to say inactive rather than failed, you're correct.  You're also 
right that I could start my wireless from local.start, but this wouldn't 
*quite* solve the problem.

The issue is that even though ifplug recognizes that eth0 is inactive, 
baselayout isn't starting eth1 instead; it just seems to skip eth1 (even 
though it's on the same runlevel), and any net-dependent rc scripts after 
that say they'll start when net.eth0 starts.  I'd like them to start when 
*any* net.eth* starts.

The funny thing is, if net.eth0 succeeds in starting, then it *will* 
start eth1 immediately after.  Just the opposite of the expected - it 
only starts the alternate interface when you don't need it!

> You should also edit /etc/conf.d/net to shut down eth1 when eth0 
> detects a cable. I have this as the preup function
> 
> preup() {
>   [ ${IFACE} == "eth0" ] && /etc/init.d/net.eth1 --quiet status && /etc/init.d/net.eth1 pause
>   return 0
> }

Thanks for this - it looks quite handy.  Is preup() executed after ifplug 
notices a connection?  When does postup() occur, if that's the case?

I'm having another funny problem today that I can't work out - DHCP 
stopped working for wireless.  I odn't think I've changed anything.  DHCP 
works fine on the wired connection, and wireless works fine if I set an 
explicit IP, but not with DHCP.  Perhaps something related to the newest 
baselayout?

Thanks,
Tom
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Re: Re: net.eth0 and net.eth1 choice + net.eth1 timeout
  2006-02-18 19:58         ` [gentoo-user] " Thomas Kirchner
@ 2006-02-18 23:34           ` Neil Bothwick
  0 siblings, 0 replies; 8+ messages in thread
From: Neil Bothwick @ 2006-02-18 23:34 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

On Sat, 18 Feb 2006 14:58:24 -0500, Thomas Kirchner wrote:

> > preup() {
> >   [ ${IFACE} == "eth0" ] && /etc/init.d/net.eth1 --quiet status
> > && /etc/init.d/net.eth1 pause return 0
> > }
> 
> Thanks for this - it looks quite handy.  Is preup() executed after
> ifplug notices a connection?  When does postup() occur, if that's the
> case?

preup is executed by net.eth* before bringing up the interface, so this
brings down eth1 before eth0 is set up, otherwise things may get
confused. Using pause rather that stop means dependent services aren't
stopped. postup is run after the interface is up, so this is where, for
example, you might want to mount network filesystems.


-- 
Neil Bothwick

 ... We are Dyslexics of Borg. Your ass will be laminated.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-02-18 23:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-17  8:29 [gentoo-user] net.eth0 and net.eth1 choice + net.eth1 timeout Marco Calviani
2006-02-17  8:46 ` Heinz Sporn
2006-02-17  9:04   ` Marco Calviani
2006-02-17  9:46   ` Neil Bothwick
2006-02-17 13:56     ` [gentoo-user] " Thomas Kirchner
2006-02-17 16:16       ` Neil Bothwick
2006-02-18 19:58         ` [gentoo-user] " Thomas Kirchner
2006-02-18 23:34           ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox