l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
November 4: Social gathering
Next Installfest:
TBD
Latest News:
Oct. 10: LUGOD Installfests coming again soon
Page last updated:
2009 Feb 05 09:53

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Automatic wifi settings on boot?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Automatic wifi settings on boot?



>>>>> On Wed, 4 Feb 2009 10:56:15 -0800, Bill Kendrick <nbs@sonic.net> said:

BK> Any tips or links to good howtos?  (This is on ubuntu 8.10 btw)

What I do is a nasty hack looking through iwlist scan output for
networks I want to use that require keys, etc (see below).

The more modern approach seems to be using NetworkManager after boot and
after login instead, which makes sense for many wireless networks where
you need a browser to log-in before anything is usable.  The biggest
problems are when the network comes up, gets and address that isn't
fully usable yet and then things like cups, etc can time-out doing DNS
or something while starting up which really slows the process down.


But here's my /etc/sysconfig/networking/ifcfg-eth1 file (the important parts):

  DEVICE=eth1
  BOOTPROTO=dhcp
  ONBOOT=yes
  USERCTL=yes
  #
  # if we have wired net, then don't do anything
  #

  ifconfig eth0 | grep 'UP' > /dev/null
  if test $? = 0 ; then
    ONBOOT=no
    ESSID=bogusbogus
  else
    # do a bogus search once just to get some boot-strapping and searching
    # this seems to help find things better by running it twice.
    iwlist scan 2>&1 > /dev/null
    # search for known local mac addresses in nearby wireless hubs
    # (these are wireless boxes for myself and family with identical setups)
    iwlist scan 2>&1 | egrep '(00:11:22:33:44:55|66:77:88:99:AA:BB)' > /dev/null
    if test $? = 0 > /dev/null ; then
      KEY=xxxxxxxx
      ESSID=foobar
    else
      # I changed this to "no" a while back to deal with the above cups issue
      ONBOOT=no
    fi
  fi
  TYPE=Ethernet

Obviously, you could expand on the concept more than the above shows you.

-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.