[Dextrose] ip route in rc.sysinit

Bernie Innocenti bernie at codewiz.org
Tue Aug 10 16:09:13 EDT 2010

El Tue, 10-08-2010 a las 09:17 -0300, Esteban Bordon escribió:
> The script try to connect to the Access Point that have the better
> signal using iwlist, iwconfig and dhclient. If dhclient return 0 it
> executes ip route to obtain the server IP and it download a few files.

If you set all the access points in the school to the same ESSID, then
clients will automatically connect to the AP with best signal and even
switch to a different one if you move around (however, since background
scanning is slow, you might loose association if you move around too

Regarding the server ip, it would be cool if you could use the DNS. dhcp
could configure one nameserver on the client and an automatic search
domain. For example, in the school where I'm sitting now I get this in
my /etc/resolv.conf:

  domain escuela485.caacupe.paraguayeduca.org
  search escuela485.caacupe.paraguayeduca.org

The DNS managed by the schoolserver has a zone called
"escuela485.caacupe.paraguayeduca.org", in which there's a host
"schoolserver". With all this infrastructure in place, all you need to
do to download a file is:

  wget http://schoolserver/file

> This script must to run before user takes control of the OS. My idea
> is add the script at initrd but later.

If the script runs before NetworkManager is started, you might manually
configure the network like this:

   ifconfig eth0 up
   iwconfig eth0 essid $AP_ESSID key off
   dhclient eth0

If everything goes well, when dhclient exits you should have a valid,
IP, route and DNS.

   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/

More information about the Dextrose mailing list