OVH Cloud OVH Cloud

[whereami] Problème de conf

4 réponses
Avatar
giggz
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


--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs "From" et
"Reply-To:"

To UNSUBSCRIBE, email to debian-user-french-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

4 réponses

Avatar
fra-duf-no-spam
Le 13491ième jour après Epoch,
écrivait:

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.



Tu peux par exemple faire un truc du genre:

elif lan
# If the testmii at the top was successful
set INTERFACE eth0
testdhcp '*.*.*.*' dhcp



always at remove_wlan

# 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



et mettre dans ton whereami.conf un truc du genre:

+remove_wlan /sbin/ifdown eth1
-remove_wlan /sbin/ifup eth1

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



Le principe de whereami est de trouver une *liste* de /locations/
valides. Faire un /notat/ retire de la liste l'élément en questio n.
Avatar
giggz
François TOURDE a écrit :
Le 13491ième jour après Epoch,
écrivait:

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.



Tu peux par exemple faire un truc du genre:

elif lan
# If the testmii at the top was successful
set INTERFACE eth0
testdhcp '*.*.*.*' dhcp



always at remove_wlan

# 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



et mettre dans ton whereami.conf un truc du genre:

+remove_wlan /sbin/ifdown eth1
-remove_wlan /sbin/ifup eth1

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



Le principe de whereami est de trouver une *liste* de /locations/
valides. Faire un /notat/ retire de la liste l'élément en question.



Oki dc en mettant "always notat wlan,wdhcp" comme suit :

elif lan
# If the testmii at the top was successful
set INTERFACE eth0
testdhcp '*.*.*.*' dhcp
always notat wlan,wdhcp
# 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

ça marche aussi non ?

En fait j'essaye le moins possible d'utiliser des commandes ds le
whereami.conf et de jouer le plus possible sur la syntaxe...

Merci en tt cas
Guillaume


--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs "From" et
"Reply-To:"

To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Avatar
David BERCOT
Bonjour,

Je ne vais pas faire avancer le schmilblick, mais, comme j'ai initié un
thread sur le sujet la semaine dernière, je voulais juste vous dire où
j'en étais...
1. Encore merci à vous tous (notamment François ;-)) pour vos bons
conseils en la matière...
2. Ceci étant dit, je suis revenu à guessnet ;-) En fait, je n'ai pas
vraiment réussi à faire tourner correctement whereami (j'avais surtout
des problèmes de compréhension sur la cinématique des différentes
intervenants) et comme mes nouveaux tests avec guessnet ont été
réussis...

Bon week-end.

David.


--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs "From" et
"Reply-To:"

To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Avatar
fra-duf-no-spam
Le 13491ième jour après Epoch,
écrivait:


Oki dc en mettant "always notat wlan,wdhcp" comme suit :




[...]

ça marche aussi non ?



Ben je sais pas, j'ai pas l'ensemble du fichier donc je ne peux pas
vraiment savoir...

Et puis à toi de réflêchir un peu, et d'essayer ;)