ad-hoc: nano /etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet dhcp auto wlan0 iface wlan0 inet static address 192.168.2.1 netmask 255.255.255.0 wireless-channel 1 wireless-essid PIWI wireless-mode ad-hoc auto eth0 structure auto wlan0 iface wlan0 inet dhcp wpa-ssid ESSID wpa-psk PWD
soit créer un fichier /etc/wpa_supplicant/wpa_supplicant.conf <code>
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1
network={
ssid="Your SSID Here" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP psk="YourPresharedKeyHere"
} </code>
sudo nano /etc/network/interfaces
Replace it with the following profile:
auto wlan0 iface wlan0 inet dhcp wpa-ssid [ESSID] wpa-psk [PASSPHRASE]
sudo ifconfig <html><interface></html> down sudo dhclient -r <html><interface></html>\\ sudo ifconfig <html><interface></html> 192.168.1.100 netmask 255.255.255.0 up sudo route add default gw 192.168.1.1 sudo iwconfig <html><interface></html> essid "ESSID_IN_QUOTES" sudo iwconfig <html><interface></html> mode Managed
si DHCP wpa
sudo wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 sudo dhclient wlan0 ping x.org
# PB de routage quand connexion simultannée eth0 et wlan0 # sudo route add default netmask 255.255.255.0 gw 192.168.1.254 wlan0 # sudo route add default netmask 0.0.0.0 gw 192.168.1.254 wlan0 # dernière ligne indispensable pour routage net ok à conf avec eth0 up ... # $ route # Table de routage IP du noyau # Destination Passerelle Genmask Indic Metric Ref Use Iface # default bbox.lan 255.255.255.0 UG 0 0 0 wlan0 # default bbox.lan 0.0.0.0 UG 0 0 0 wlan0 # 192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
If when using static IP addresses you are getting a problem with name resolution, you will have to specifiy specific dns (domain name servers) in order to translate URLs to IP addresses. Unfortunately there is not an easy way to configure this from the command line. This requires that you edit the /etc/resolv.conf file and manually enter the domain name server(s) you want to use. In many cases users can specifiy their router, their internet service providers dns servers, or use opendns (or use all three). Up to three nameservers can be specified.
sudo nano /etc/resolv.conf nameserver 208.67.222.222 nameserver 208.67.220.220
mettre
user:pi group:pi
dans /opt/piratebox/conf/lighttpd/lighttpd.conf et ../piratebox.conf (en bas du fichier)