[Toulibre] S O S Raspberry Pi comme hotspot WiFi
jlp
jlp31 at free.fr
Dim 2 Fév 12:31:30 CET 2014
Le vendredi 31 janvier 2014 21:30:11 Guillaume Betous a écrit :
> qques idées en vrac :
>
bonjour
merci pour ces suggestions
>
> - udhcp a l'air de donner une adresse de resolution DNS 'en dur' :
> 212.27.48.10 => est-ce bien la bonne ?
>
j'ai obtenu cette adresse depuis mon pc de dév :
nslookup
> free.fr
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: free.fr
Address: 212.27.48.10
>
> - opt router 10.0.0.1 => ton raspberry est-il bien à cette adresse ?
>
ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:48:c2:f0
inet adr:192.168.1.205 Bcast:255.255.255.255 Masque:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:877 errors:0 dropped:0 overruns:0 frame:0
TX packets:1241 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:109421 (106.8 KiB) TX bytes:179944 (175.7 KiB)
lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
mon.wlan0 Link encap:UNSPEC HWaddr B0-48-7A-92-1D-DD-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:341 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:65161 (63.6 KiB) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr b0:48:7a:92:1d:dd
inet adr:10.0.0.1 Bcast:10.0.0.255 Masque:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:468 errors:0 dropped:17 overruns:0 frame:0
TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:35383 (34.5 KiB) TX bytes:7878 (7.6 KiB)
>
> gUI
>
j'ai recommencé toute l'instal avec dnsmasq à la place de udhcpd, même problème, ça ne route pas :-(
JLP
> 2014-01-31 jlp <jlp31 at free.fr>:
> > bonsoir
> >
> > en suivant quelques tutos j'ai connecté un TP-LINK TL-WN722N sur
> > un Raspberry Pi sur lequel était déjà installé un serveur https
> >
> > je peux me connecter avec une tablette android qui prend l'adresse
> > 10.0.0.22 (ça déconne déjà, voir plus bas)
> >
> > avec la tablette android je peux surfer en https sur le serveur web
> > du Raspberry Pi
> >
> > mais je ne peux pas aller sur internet avec la tablette android
> >
> > je n'arrive plus à voir quelle connerie j'ai pu faire, c'est d'autant
> > plus pénible que ça avait fonctionné du premier coup l'année
> > dernière...
> >
> > toute aide bienvenue, merci !
> >
> > JLP
> >
> >
> >
> >
> > sudo apt-get -y install hostapd udhcpd
> >
> > brancher le TP-LINK TL-WN722N
> >
> > sudo vi /etc/network/interfaces
> >
> > iface wlan0 inet static
> >
> > address 10.0.0.1
> > netmask 255.255.255.0
> >
> > auto lo
> >
> > iface lo inet loopback
> > iface eth0 inet dhcp
> >
> > # allow-hotplug wlan0
> > # iface wlan0 inet manual
> > # wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
> > iface default inet dhcp
> > up iptables-restore < /etc/iptables.ipv4.nat
> >
> > sudo vi /etc/iptables.ipv4.nat
> >
> > # Generated by iptables-save v1.4.14 on Fri Jan 31 16:05:36 2014
> > *filter
> >
> > :INPUT ACCEPT [8:416]
> > :FORWARD ACCEPT [0:0]
> > :OUTPUT ACCEPT [8:1408]
> >
> > -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j
> > ACCEPT
> > -A FORWARD -i wlan0 -o eth0 -j ACCEPT
> > COMMIT
> > # Completed on Fri Jan 31 16:05:36 2014
> > # Generated by iptables-save v1.4.14 on Fri Jan 31 16:05:36 2014
> > *nat
> >
> > :PREROUTING ACCEPT [0:0]
> > :INPUT ACCEPT [0:0]
> > :OUTPUT ACCEPT [1:196]
> > :POSTROUTING ACCEPT [0:0]
> >
> > -A POSTROUTING -o eth0 -j MASQUERADE
> > COMMIT
> > # Completed on Fri Jan 31 16:05:36 2014
> >
> > sudo vi /etc/hostapd/hostapd.conf
> >
> > interface=wlan0
> > ssid=MY_SSID
> > hw_mode=g
> > channel=6
> > auth_algs=1
> > wmm_enabled=0
> >
> > wpa=2
> > wpa_passphrase=MY_PASSWORD
> > wpa_key_mgmt=WPA-PSK
> > wpa_pairwise=TKIP
> > rsn_pairwise=CCMP
> >
> > sudo vi /etc/default/hostapd
> >
> > DAEMON_CONF="/etc/hostapd/hostapd.conf"
> >
> > sudo vi /etc/sysctl.conf
> >
> > kernel.printk = 3 4 1 3
> > net.ipv4.ip_forward=1
> > vm.swappiness=1
> > vm.min_free_kbytes = 8192
> >
> > sudo vi /etc/default/udhcpd
> >
> > # Comment the following line to enable
> > # DHCPD_ENABLED="no"
> >
> > # Options to pass to busybox' udhcpd.
> > #
> > # -S Log to syslog
> > # -f run in foreground
> >
> > DHCPD_OPTS="-S"
> >
> > sudo vi /etc/udhcpd.conf
> >
> > # Sample udhcpd configuration file (/etc/udhcpd.conf)
> >
> > # The start and end of the IP lease block
> >
> > start 10.0.0.100 # start 192.168.0.20 #default:
> > 192.168.0.20 end 10.0.0.199 # end 192.168.0.254 #default:
> > 192.168.0.254
> >
> >
> > # The interface that udhcpd will use
> >
> > interface wlan0 # interface eth0 #default: eth0
> >
> >
> > # The maximim number of leases (includes addressesd reserved
> > # by OFFER's, DECLINE's, and ARP conficts
> >
> > #max_leases 254 #default: 254
> >
> >
> > # If remaining is true (default), udhcpd will store the time
> > # remaining for each lease in the udhcpd leases file. This is
> > # for embedded systems that cannot keep time between reboots.
> > # If you set remaining to no, the absolute time that the lease
> > # expires at will be stored in the dhcpd.leases file.
> >
> > #remaining yes #default: yes
> >
> >
> > # The time period at which udhcpd will write out a dhcpd.leases
> > # file. If this is 0, udhcpd will never automatically write a
> > # lease file. (specified in seconds)
> >
> > #auto_time 7200 #default: 7200 (2 hours)
> >
> >
> > # The amount of time that an IP will be reserved (leased) for if a
> > # DHCP decline message is received (seconds).
> >
> > #decline_time 3600 #default: 3600 (1 hour)
> >
> >
> > # The amount of time that an IP will be reserved (leased) for if an
> > # ARP conflct occurs. (seconds
> >
> > #conflict_time 3600 #default: 3600 (1 hour)
> >
> >
> > # How long an offered address is reserved (leased) in seconds
> >
> > #offer_time 60 #default: 60 (1 minute)
> >
> > # If a lease to be given is below this value, the full lease time is
> > # instead used (seconds).
> >
> > #min_lease 60 #defult: 60
> >
> >
> > # The location of the leases file
> >
> > #lease_file /var/lib/misc/udhcpd.leases #defualt:
> > /var/lib/misc/udhcpd.leases
> >
> > # The location of the pid file
> > #pidfile /var/run/udhcpd.pid #default: /var/run/udhcpd.pid
> >
> > # Everytime udhcpd writes a leases file, the below script will be
> > called.
> > # Useful for writing the lease file to flash every few hours.
> >
> > #notify_file #default: (no script)
> >
> > #notify_file dumpleases # <--- useful for debugging
> >
> > # The following are bootp specific options, setable by udhcpd.
> >
> > #siaddr 192.168.0.22 #default: 0.0.0.0
> >
> > #sname zorak #default: (none)
> >
> > #boot_file /var/nfs_root #default: (none)
> >
> > # The remainer of options are DHCP options and can be specifed with the
> > # keyword 'opt' or 'option'. If an option can take multiple items, such
> > # as the dns option, they can be listed on the same line, or multiple
> > # lines. The only option with a default is 'lease'.
> >
> > #Examles
> > opt dns 212.27.48.10 # opt dns 192.168.10.2 192.168.10.10
> > option subnet 255.255.255.0
> > opt router 10.0.0.1 # opt router 192.168.10.2
> > # opt wins 192.168.10.10
> > # option dns 129.219.13.81 # appened to above DNS servers
> > for a total of 3 option domain local
> > option lease 864000 # 10 days of seconds
> >
> >
> > # Currently supported options, for more info, see options.c
> > #opt subnet
> > #opt timezone
> > #opt router
> > #opt timesrv
> > #opt namesrv
> > #opt dns
> > #opt logsrv
> > #opt cookiesrv
> > #opt lprsrv
> > #opt bootsize
> > #opt domain
> > #opt swapsrv
> > #opt rootpath
> > #opt ipttl
> > #opt mtu
> > #opt broadcast
> > #opt wins
> > #opt lease
> > #opt ntpsrv
> > #opt tftp
> > #opt bootfile
> > #opt wpad
> >
> > # Static leases map
> > #static_lease 00:60:08:11:CE:4E 192.168.0.54
> > #static_lease 00:60:08:11:CE:3E 192.168.0.44
> >
> > sudo service hostapd restart
> >
> > sudo service udhcpd restart
> >
> >
> > --
> > --------8<--------8<--------8<--------8<--------8<--------
> >
> > Jean-Louis Patané
> > jlp31 at free.fr
> > http://jlp31.free.fr/cv.html
> >
> > DES OUTILS GRATUITS POUR PROMOUVOIR MON CV :
> > http://jlp31.free.fr/cvware/index.html
> >
> > LA MUSIQUE ADOUCIT LES MOEURS :
> > http://junkofunk.free.fr/
> > http://jlpmusic.free.fr/
> > http://eindharmoniemuret.free.fr/
> > http://harmoniedauterive.free.fr/
> > http://jlp31.free.fr/musique.html
> >
> > --------8<--------8<--------8<--------8<--------8<--------
> >
> > _______________________________________________
> > Toulouse-ll mailing list
> > Toulouse-ll at toulibre.org
> > http://toulibre.org/cgi-bin/mailman/listinfo/toulouse-ll
--
--------8<--------8<--------8<--------8<--------8<--------
Jean-Louis Patané
jlp31 at free.fr
http://jlp31.free.fr/cv.html
DES OUTILS GRATUITS POUR PROMOUVOIR MON CV :
http://jlp31.free.fr/cvware/index.html
LA MUSIQUE ADOUCIT LES MOEURS :
http://junkofunk.free.fr/
http://jlpmusic.free.fr/
http://eindharmoniemuret.free.fr/
http://harmoniedauterive.free.fr/
http://jlp31.free.fr/musique.html
--------8<--------8<--------8<--------8<--------8<--------
Plus d'informations sur la liste de diffusion Toulouse-ll