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

detecting which eth0 config [was Re: gdm fails]



I used whereami (worked) and then guessnet (worked better)
and now a little script that's still a little rough.

Basically it outputs "work" or "home" or "site" based on
  ifconfig eth0 up # bring up eth0 without ip
  if arping <opts> <ip addr> | grep -q <mac addr>; then echo work
  elif arping <opts> <ip addr> | grep -q <mac addr>; then echo home
  ...
  ifconfig eth0 down # take ifconfig back down so ifup can doit 'right' for this net

I use the form of arping that's mac-only, but I don't
remember the opts for that right now.

Anyho, your script can then be put into the 'script' line
of your eth0 stanza (read man interfaces to find out about
the script line).

If you still need help tomorrow, let me know and I'll get
the full config off my laptop.

Tony

According to Aswin Venkat,
> 
> 
> Hi all-
> 
>  > > 
>  > Well, this is not that easy. We need to know a lot about your "network".
>  > 
>  > First: Direct connection to the Internet from your machine (i.e. Modem -
>  > what ever type - in/connected to your machine) or connection via a LAN
>  > and a router?
> 
> Actually this is part of the problem. At home i have a connection via
> a modem to the internet(through a gateway). At school however, the
> connection goes via a LAN and router.
> 
> I was able to get the network running from home. I installed the package
> laptop-net that uses debconf to guide the installation and it
> worked. However, i am not sure how to handle two sets of networks--is
> there a way the laptop can detect which network its on and get on it
> or do i need two sets of /etc/interfaces/network files?
> 
> 
> Essentially i want to have a /etc/interfaces/network file that does
> something like
> 
> if @home then eth0 uses first network
> else
> if@school then eth0 uses the school network
> else
> eth0 uses available network(or atleast tries to)
> 
> I installed the whereami package which i thought should do that but i
> was'nt able to get that to work. I read about another package ifplugd
> that supposedly does that(available in the unstable distribution--i
> have the stable version installed currently)
> , i have'nt tried that out yet but i was
> wondering if there is another way to do it
> 
>  > 
>  > Second: What bandwidth do you have? Just to make sure you have a
>  > connection allowing you to download all the nice things we propose to
>  > you - before Xmas next year ;-)
> 
> The bandwidth is quite good(especially at school)
> so i don't see a problem downloading stuff--chances are it
> should be done well before
> Xmas this year, not next;-) 
> 
> Also, lets say i add the following lines to my /etc/apt/sources.list,
> can then just use
> 
> > >  > 
>  > >  > #### XFree 4.3 backport
>  > >  > #### this should work as of today (2003-10-22), delivers 4.3.0
>  > >  > deb http://people.debian.org/~mmagallo/packages/xfree86/i386/ ./
>  > >  > #### I got my XFree 4.3 from the  ximian-desktop 2 project, but at 
>  > >  > ##### this time the server kicks me on connect.
>  > >  > #### TRY OUT by uncommenting below two lines
>  > >  > #deb ftp://linux.upsa.es/pub/RC2/ ./
>  > >  > #deb ftp://linux.upsa.es/pub/OO.O/ ./
>  > >  > 
>  > >  > #### Gnome 2.2 backport to woody, including evolution 1.4.5
>  > >  > deb
>  > >  > http://ftp.acc.umu.se/mirror/mirrors.evilgeniuses.org.uk/debian/backports/woody gnome2.2/
>  > >  > deb-src
>  > >  > http://ftp.acc.umu.se/mirror/mirrors.evilgeniuses.org.uk/debian/backports/woody gnome2.2/
>  > >  > 
>  > >  > ##### MPlayer 
>  > >  >  deb http://marillat.free.fr stable main
>  > >  > 
>  > >  > ##### Mozilla 1.4
>  > >  >  deb http://debian.relativ.org/ ./
>  > >  > 
>  > >  > #### official sources
>  > >  > # deb-src http://ftp.debian.org/debian stable main contrib non-free
>  > >  > # deb-src http://ftp.de.debian.org/debian-non-US stable/non-US main
>  > >  > contrib non-free
>  > >  > 
>  > >  > # EOF
>  > >  > --- snap ---
> 
> 
> apt-get update
> 
> to install Xfree86 4.3/gnome2.2 etc or do i have to use
> 
> apt-get install XFree86
> 
>  
> Thanks,
> Aswin
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-laptop-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: