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

[whereami] Problème de conf



Slt la liste,

Bon il y a déjà eu un fil sur whereami (qui m'a poussé à tester la
chose) cette semaine, en voilà un autre :
mon problème :
j'ai un portable avec 2 interfaces eth0 (lan) et wifi (eth1). Je veux
que dans le cas où un rj45 est branché avec "du net dedans" :) , la
connection internet soit activée par l'ethernet et seulement pour
l'ethernet dc pour eth0. Si aucun rj45 n'est branché, alors le wifi
tourne en permanence à la recherche d'AP.

Bon voilà ce que j'ai fait :
j'ai ifplugd qui tourne sur eth0 et eth1. aucun problème à ce niveau. En
effet avant je tournais juste avec ifplugd et ça marchait très bien (ie
quand il y avait de l'ethernet, eth0 s'établissait; qd y avait du wifi
eth1 se mettait en marche). Mais la situation que je voudrais éviter est
que les 2 interfaces soient actives au meme monent.

Bon j'ai installé whereami pour résoudre ce problème. Voilà ce que j'ai
dans les fichiers de configuration :
detect.conf
# It is a good idea to default to somewhere...
default undocked

# Test for the presence of an ethernet connection plugged into eth0
testmii eth0 lan

# Uncomment this for exhaustive debugging output
# set DEBUGWHEREAMI 1

# 'down' might be a location that is forced from the command line
# like "whereami down"
if down
  always at undocked
  always notat eth0,eth1
elif stop
  # Or maybe we can't remember the exact command, so we do it twice!
  # like "whereami stop" this time
  always at undocked
  always notat eth0,eth1
elif lan
  # If the testmii at the top was successful
  set INTERFACE eth0
  testdhcp    '*.*.*.*'    dhcp
  # testarp     eth0,00:24:5e:17:12:11,10.2.0.4  morrinsville
  # testping    192.168.138.1,192.168.138.55     queenstown
  # testping    202.49.41.18,202.49.41.1         rotorua
else
  # If the testmii at the top failed
  # modprobe prism54 w_eth1
  # always modprobe orinoco w_eth1
  # always modprobe ath_pci atheros
  # always modprobe ipw2100 w_eth1
  # ... and we unload this in whereami.conf, if we don't find one,
  # in an attempt to minimise power, and RFI
  notat lan
  set INTERFACE eth1
  testap scan wlan
fi

#if w_eth1
#  # Some wireless drivers use one interface name
#  set INTERFACE eth1
#  testap scan wlan
#fi

#if atheros
#  # And some use a different one
#  set INTERFACE ath0
#  testap scan wlan
#fi

# If we have found at least some WLAN APs in the vicinity, find out
# if we can do anything with any of them
if wlan
  # testap      milford,1234-5FED-CB                      milford,wdhcp
  # testap      wanaka,1234-2468-1357-dead-beef-feed-99  wanaka,wdhcp
  # testap      ruapehu                 ruapehu,wdhcp
  # # If there's anything there at all, try and DHCP off it
    testap      .+                  wdhcp
  # # And if there isn't, we will indicate that.
    notat  wlan,wdhcp
fi

# So it seems we should try and get DHCP off a WLAN AP
if wdhcp
   testdhcp    '*.*.*.*'    dhcp
fi

# And if we have DHCP (wired or wireless) we want to make
# a decision as to which LAN that is, exactly.
if dhcp
  # testdhcp    192.168.5.*     waiheke
  # testdhcp    192.168.7.*     tauranga
  # testdhcp    192.168.10.*    wellington
  # testdhcp    192.168.55.3*   picton
  # # Note that we only get here, if the one above is _unsuccessful_
  # testdhcp    192.168.55.*    rakaia
fi

le whereami.conf est identique à l'original.

Bon pour l'instant cette configuration fonctionne ds le cas où j'ai du
net par eth0. La connexion s'établit. Je n'ai pas pu tester les autres,
n'ayant pas de wifi (de gentils voisins...) sous la main.

Bon si quelqu'un a déjà réfléchit et résolu mon problème...ben je veux
bien voir sa configuration.

Sinon j'aimerais bien comprendre qu'elles sont les conséquences du "notat"

Merci et bon we
GiGGz



Reply to: