Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Wireless]connexion au boot (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
lospericos_99
Apprentice
Apprentice


Joined: 08 Jul 2004
Posts: 236
Location: suisse (genève)

PostPosted: Wed Mar 08, 2006 10:38 am    Post subject: [Wireless]connexion au boot (résolu) Reply with quote

Hello, j'ai un portable qui a une carte wifi ipw2200, elle fonctionne très bien vu que c'est par elle que je poste sur ce forum, le problème est que je ne trouve pas les infos pour quelle démarre automatiquement avec mon environnement.
ma config:
Code:
0000:02:02.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01)
0000:02:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)

Code:
portable dvd # iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11g  ESSID:"gentoo"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:12:17:48:40:07
          Bit Rate=36 Mb/s   Tx-Power=20 dBm
          Retry limit:7   RTS thr:off   Fragment thr:off
          Encryption key:****************   Security mode:open
          Power Management:on
          Link Quality=85/100  Signal level=-45 dBm  Noise level=-79 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:425   Missed beacon:3

J'utilise une key WEP, le bouton fonctionne avec acerhk.

Au boot j'ai configuré net.eth1 par defaut, dmesg ne me mets pas d'erreur mais je doit procéder comme suit pour avoir la connexion:
Code:
portable dvd # iwconfig eth1 essid gentoo
portable dvd # iwconfig eth1 key ********************
portable dvd # iwconfig eth1 power on

à ce stade la led du bouton s'allume en fixe et arrête de clignoter mais la connexion ne fonctionne pas tant que je ne fais pas un:
Code:
portable dvd # dhcpcd eth1

(la led se met a clignoter au moment ou le module se charge au boot)

J'ai regardé:
/etc/conf.d/net
/etc/conf.d/wireless.example

mais je sêche un peu...


Last edited by lospericos_99 on Wed Mar 08, 2006 12:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
kaworu
Guru
Guru


Joined: 07 Dec 2005
Posts: 450

PostPosted: Wed Mar 08, 2006 12:01 pm    Post subject: Reply with quote

Salut !
perso j'utilise un script que j'ai trouvé sur le wiki gentoo ( ICI ) :
Code:

#!/sbin/runscript
        #ID du point d'acces
        ESSID="WANADOO-xxxx"
        #Cle WEP
        WEP="votre clé"

        #Pour avoir une IP grace au DHCP
        dhcp_request() {
                ebegin "Lancement de la requete DHCP"

                if [ -f "/var/run/dhcpcd-wlan0.pid" ]
                then
                        rm -rf /var/run/dhcpcd-wlan0.pid
                fi

                if [ `/sbin/dhcpcd wlan0 &` ]
                then
                        einfo "Erreur, DHCP indisponible !"
                else
                        #recupere l'adresse ip configuree pour l'afficher
                        ip_dhcp=$(ifconfig wlan0 | grep "inet addr:" | cut -d' ' -f 12 | cut -c5-99)
                        einfo "Adresse IP attribuee : $ip_dhcp"
                fi
                eend 0
        }
        start() {
                ebegin "Activation du wifi"
                iwconfig wlan0 mode managed essid $ESSID key $WEP
                dhcp_request
                eend 0
        }
        stop() {
                ebegin "Desactivation du wifi"
                ifconfig wlan0 down &>/dev/null
                rm -rf /var/run/dhcpcd-wlan0.pid
                eend 0
        }
        restart() {
                svc_stop
                svc_start
        }


après il faut un peu adapter, pour toi je pense que ça dois resembler à ça (je te post le script de feu mon portable avec ipw2200) :
Code:

#!/sbin/runscript
        #ID du point d'acces
        ESSID="WANADOO-xxxx"
        #Cle WEP
        WEP="votre clé"

        #Pour avoir une IP grace au DHCP
        dhcp_request() {
                ebegin "Lancement de la requete DHCP"

                if [ -f "/var/run/dhcpcd-eth1.pid" ]
                then
                        rm -rf /var/run/dhcpcd-eth1.pid
                fi

                if [ `/sbin/dhcpcd eth1 &` ]
                then
                        einfo "Erreur, DHCP indisponible !"
                else
                        #recupere l'adresse ip configuree pour l'afficher
                        ip_dhcp=$(ifconfig eth1 | grep "inet addr:" | cut -d' ' -f 12 | cut -c5-99)
                        einfo "Adresse IP attribuee : $ip_dhcp"
                fi
                eend 0
        }
        start() {
                ebegin "Activation du wifi"
                modprobe ipw2200
                iwconfig eth1 mode managed essid $ESSID key $WEP
                dhcp_request
                eend 0
        }
        stop() {
                ebegin "Desactivation du wifi"
                ifconfig eth1 down &>/dev/null
                rm -rf /var/run/dhcpcd-eth1.pid
                modprobe -r ipw2200 ipw_crypt_wep ipw_crypt ieee
                eend 0
        }
        restart() {
                svc_stop
                svc_start
        }

Il suffit de le mettre dans /etc/init.d/ et de le rendre executable, puis un petit
Code:

#rc-update add net.wifi default


PS : pour le portable, j'ai rajouté le chargement et déchargement du module ipw2200 ( y'a aussi les autres, je sais plus trop les noms et y'a un ordre précis car ce sont des dépendences donc tu peux pas stopper un modules qui est encore utilisé par un autre ) , comme ça ba tu désactive ta carte wifi.
_________________
Macbook
Core2Duo @ 2.0GHz - 1Go RAM - HD 80Go - Intel GMA 945

Gentoo GNU/Linux
~amd64 - 2.6.24-gentoo-r2 - Fluxbox || (KDE && Compiz-Fusion)
Back to top
View user's profile Send private message
lospericos_99
Apprentice
Apprentice


Joined: 08 Jul 2004
Posts: 236
Location: suisse (genève)

PostPosted: Wed Mar 08, 2006 12:15 pm    Post subject: Reply with quote

Salut kaworu c'est exactement ce dont j'avais besoin.
Merci bien
-> résolu
Back to top
View user's profile Send private message
MaKKrO
Apprentice
Apprentice


Joined: 04 Oct 2005
Posts: 265
Location: Paris - FRANCE

PostPosted: Wed Mar 08, 2006 2:48 pm    Post subject: Reply with quote

C'est clair, il déchire ce pti script...

Merci bien ! :wink:
_________________
Loisirs = Gentoo / Taff = Gentoo / Pourtant Taff != Loisirs
Back to top
View user's profile Send private message
bibi.skuk
Guru
Guru


Joined: 01 Aug 2005
Posts: 425

PostPosted: Wed Mar 08, 2006 2:54 pm    Post subject: Reply with quote

les variables mises en haut du script... erk...

Pour tout script d'init, par exemple /etc/init.d/kiten, tu peut avoir un fichier /etc/conf.d/kiten qui contiendra tes variables de confs...

Bon, voila...
Back to top
View user's profile Send private message
lospericos_99
Apprentice
Apprentice


Joined: 08 Jul 2004
Posts: 236
Location: suisse (genève)

PostPosted: Wed Mar 08, 2006 3:17 pm    Post subject: Reply with quote

Ah ah le petit script évolu, en tout cas il me simplifie la vie..
Back to top
View user's profile Send private message
kaworu
Guru
Guru


Joined: 07 Dec 2005
Posts: 450

PostPosted: Thu Mar 09, 2006 9:02 am    Post subject: Reply with quote

bibi.skuk wrote:
les variables mises en haut du script... erk...

Pour tout script d'init, par exemple /etc/init.d/kiten, tu peut avoir un fichier /etc/conf.d/kiten qui contiendra tes variables de confs...

Bon, voila...


thx pour l'astuce ! effectivement c'est vraiment plus propre ! ^___^
_________________
Macbook
Core2Duo @ 2.0GHz - 1Go RAM - HD 80Go - Intel GMA 945

Gentoo GNU/Linux
~amd64 - 2.6.24-gentoo-r2 - Fluxbox || (KDE && Compiz-Fusion)
Back to top
View user's profile Send private message
lospericos_99
Apprentice
Apprentice


Joined: 08 Jul 2004
Posts: 236
Location: suisse (genève)

PostPosted: Sun Mar 12, 2006 9:23 am    Post subject: Reply with quote

salut, ton script fonctionne à merveille mais j'ai eu un petit problème récement, j'ai activé le script dans le runlevel default et configuré pour mon réseau, seulement j'ai emporté mon pc (portable) avec moi et comme la connexion n'éxistait plus le pc est resté figé au démarrage lors du chargement du wifi... j'ai pu redemarré avec un autre noyau qui n'avait pas le support pour ma carte wifi et j'ai supprimer le script du runlevel...

maintenant je le lance à la mano après un démarrage ça évite ce genre de problème.

voilà pour info à ceux qui veulent l'utiliser en nomade.
Back to top
View user's profile Send private message
kaworu
Guru
Guru


Joined: 07 Dec 2005
Posts: 450

PostPosted: Sun Mar 12, 2006 9:48 am    Post subject: Reply with quote

tu peux simplement faire CTRL+C lorsque le script s'active et que tu n'est pas chez toi :wink: si tu veux le laisser en runlevel default.
_________________
Macbook
Core2Duo @ 2.0GHz - 1Go RAM - HD 80Go - Intel GMA 945

Gentoo GNU/Linux
~amd64 - 2.6.24-gentoo-r2 - Fluxbox || (KDE && Compiz-Fusion)
Back to top
View user's profile Send private message
zeuss1414
Guru
Guru


Joined: 23 Mar 2004
Posts: 490

PostPosted: Sun Mar 12, 2006 10:51 am    Post subject: Reply with quote

Pas mal ce script, mais comment on fait si on se connecte souvent sur des réseau différents ...
Back to top
View user's profile Send private message
gwenn
n00b
n00b


Joined: 10 Jul 2002
Posts: 17
Location: Rennes

PostPosted: Sun Mar 12, 2006 4:02 pm    Post subject: Reply with quote

zeuss1414 wrote:
Pas mal ce script, mais comment on fait si on se connecte souvent sur des réseau différents ...


On utilise wpa_supplicant ?
Back to top
View user's profile Send private message
lospericos_99
Apprentice
Apprentice


Joined: 08 Jul 2004
Posts: 236
Location: suisse (genève)

PostPosted: Tue Mar 14, 2006 6:09 pm    Post subject: Reply with quote

kaworu wrote:
tu peux simplement faire CTRL+C lorsque le script s'active et que tu n'est pas chez toi :wink: si tu veux le laisser en runlevel default.


Non rien n'y fait...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum