Table des matières

Répéteur wifi

Ressources

Répéteur wifi : Ethernet (eht0) vers Wifi (wlan0)

Fichier /etc/dhcp/dhcpd.conf :

subnet 192.168.42.0 netmask 255.255.255.0 {
    range 192.168.42.10 192.168.42.50;
    option broadcast-address 192.168.42.255;
    option routers 192.168.42.2;
    default-lease-time 600;
    max-lease-time 7200;
    option domain-name "ClapasPi";
    option domain-name-servers 8.8.8.8, 8.8.4.4;
}

Fichier /etc/network/interfaces :

auto lo

# ETH0 (Ethernet)
iface lo inet loopback
iface eth0 inet dhcp

# WLAN0 (Wifi)
allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.42.2
  netmask 255.255.255.0

Fichier /etc/hostapd/hostapd.conf :

interface=wlan0
driver=nl80211

ssid=ClapasPi
country_code=FR
hw_mode=g
channel=6

macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0

# Sécurité WPA
wpa=2
wpa_passphrase=<mot-de-passe>
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
wpa_pairwise=CCMP
wpa_group_rekey=86400

# Use 150Mbps with wifi n
ieee80211n=1
wme_enabled=1

Fichier /etc/wpa_supplicant/wpa_supplicant.conf :

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="<YOUR-SSID>"
    psk="<YOUR-PASSWORD>"

    # Les lignes ci-dessous me semble optionnelle :
    # Protocol type can be: RSN (for WPA2) and WPA (for WPA1)
    #proto=RSN
    # Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)
    #key_mgmt=WPA-PSK
    # Pairwise can be CCMP or TKIP (for WPA2 or WPA1)
    #pairwise=TKIP
    #Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)
    #auth_alg=OPEN
}

Répéteur wifi : WIfi (wlan1) vers Wifi (PA) (wlan0)

Fichier /etc/network/interfaces :

auto lo
iface lo inet loopback

iface eth0 inet manual

auto wlan0
allow-hotplug wlan0
# Wlan0 pour se connecter à internet
#iface wlan0 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# Wlan0 en tant que Point d'acccès (eht0 vers wlan0)
iface wlan0 inet static
   address 192.168.42.1
   netmask 255.255.255.0
# Règles IPTABLE pour PA (eth0 vers wlan0) chargée au démarrage [jpm - 28-05-2016]
iptables-restore < /etc/iptables.ipv4.nat

# Wlan1 pour se connecter à internet si wlan0 est en point d'accès (PA)
allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf