Je répète :
Votre carte réseau est-elle prise en charge par hostapd?
Code:
Ok, testons pour une version simple de partage avec un bridge de la carte wifi et la carte ethernet.
Déjà, même si le fichier /etc/network/interfaces n’est pas des plus imposant, faites en une sauvegarde.
1/ Bridger la carte wifi et la carte ethernet :
copiez/coller/entrer
sudo apt-get install bridge-utils -y
sudo brctl addbr br0
sudo brctl addif br0 eth0
cat << EOF > /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
auto br0
iface br0 inet dhcp
bridge_ports eth0
EOF
2/ Installer hostapd
copiez/coller/entrer
cat << EOF > /root/installhostapd
#!/bin/bash
# Definition de quelques couleurs
red='\e[0;31m'
redhl='\e[0;31;7m'
RED='\e[1;31m'
blue='\e[0;34m'
BLUE='\e[1;34m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
NC='\e[0m' # No Colo
if [ \$USER != "root" ]
then
echo -e \$RED"Vous devez être root pour lancer ce progamme!"\$NC
exit 1
fi
VERSION=2.4
apt-get install libssl-dev -y
apt-get install libnl-genl-3-dev -y
apt-get install libnl-3-dev -y
apt-get install libnl-dev -y
cd /usr/local/src/
rm -R hostapd-\${VERSION}
wget http://w1.fi/releases/hostapd-\${VERSION}.tar.gz
tar xzvf hostapd-\${VERSION}.tar.gz
cd hostapd-\${VERSION}/hostapd
cp defconfig .config
cat << EOF >> .config
CONFIG_ACS=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211N=y
CONFIG_DRIVER_NL80211=y
# CONFIG_LIBNL32=y
CONFIG_LIBNL20=y
EOF
echo EOF >> /root/installhostapd
cat << EOF >> /root/installhostapd
make
make install
# checkinstall
cp hostapd /usr/local/sbin/
EOF
chmod +x /root/installhostapd
/root/installhostapd
3/ Creer le fichier /etc/hostapd.conf
copiez/coller/entrer
[code]cat << EOF > /etc/hostapd.conf
hostapd configuration file
ctrl_interface=/var/run/hostapd
interface=wlan0
driver=nl80211
bridge=br0
IEEE 802.11
ssid=Hotspot
hw_mode=g
channel=0
max_num_sta=128
auth_algs=1
disassoc_low_ack=1
DFS
ieee80211h=1
ieee80211d=1
country_code=FR
IEEE 802.11n
ieee80211n=1
ht_capab=[HT40+][SHORT-GI-40][DSSS_CCK-40]
wds_sta=1
WPA/IEEE 802.11i
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_passphrase=unmotdepass
wpa_pairwise=TKIP CCMP
EOF[/code]
4/ redémarrer le reseaux, activer le forwarding et lancer hostapd
copiez/coller/entrer
sysctl -w net.ipv4.ip_forward=1
/etc/init.d/networking restart
/usr/local/sbin/hostapd /etc/hostapd.conf