SliTaz SliTaz Forum

You are not logged in.

#1 2021-11-03 15:37:06

seboboch
Member
Registered: 2021-11-03
Posts: 1

Configuration point accès Wifi

Bonjour,

Je découvre linux/Slitaz que j'ai installé sur un ancien PC afin de m'en servir comme point d'accès wifi. Celui-ci est relié en ethernet au routeur/modem.

J'ai suivi ce tuto (https://anooppoommen.medium.com/create-a-wifi-hotspot-on-linux-29349b9c582d) avec utilisation d'hostapd, udhcpd et iptables.

En créant une nouvelle interface, ou sans création de celle-ci, j'arrive au même point : je n'ai pas accès à internet par le wifi. Je me connecte bien au wifi (hostapd semble donc bien configuré) avec une adresse IP qui semble correcte en 192.168.1.X (udhcpd semble donc bien fonctionner).

Je pencherai pour un problème avec iptables mais je n'ai pas réussi à l'identifier.

Voila la configuration de mon réseau :

Internet - Routeur (192.168.0.254) - PC en ethernet (192.168.0.32 pour eth0)

J'ai préféré séparer le sous-réseau wifi avec une adresse différente donc en 192.168.1.X

Config udhcpd.conf :

[c]start 192.168.1.51

end 192.168.1.120

interface wlan0

option subnet 255.255.255.0

opt router 192.168.0.32 #adresse IP de l'interface ethernet reliée à internet

option domain local

option lease 864000 # 10 days of seconds[/c]

Merci pour votre aide!

Offline

#2 2021-11-04 06:33:00

HGT
Administrator
From: Germany
Registered: 2016-03-25
Posts: 170

Re: Configuration point accès Wifi

When I tried to create a wifi access point on SliTaz, the busybox applications udhcpd and dnsd

did not work properly.

So I installed the packages dnsmasq, hostapd and iptables.

The following configurations worked for me, but should be adapted for other users:

Insert in

/etc/dnsmasq.conf:

[c]interface=wlan0
dhcp-range=10.10.0.1,10.10.0.16,12h
no-dhcp-interface=eth0[/c]
Insert or replace in

/etc/hostapd/hostapd.conf:

[c]interface=wlan0
ssid=name_for_accesspoint
country_code=DE
wpa_key_mgmt=WPA-PSK
wpa=2
wpa_passphrase=topsecret[/c]
Activate with:

[c]# ifconfig wlan0 10.10.0.1 netmask 255.255.255.0 up
# iptables --flush
# iptables --table nat --flush
# iptables --delete-chain
# iptables --table nat --delete-chain
# iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
# iptables --append FORWARD --in-interface wlan0 -j ACCEPT
# sysctl -w net.ipv4.ip_forward=1
# /etc/init.d/dnsmasq start
# /etc/init.d/hostapd start[/c]

Offline

#3 2021-11-04 18:32:53

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: Configuration point accès Wifi

@seboboch,

Je ne sais pas si cela répond à ta question mais sur SliTaz tu ne peux utiliser qu'une seule interface : dans [c]/etc/network.conf[/c] si [c]WIFI="no"[/c] (par défaut), alors seule la connexion ethernet fonctionne ; quand [c]WIFI="yes"[/c], seule la connexion wi-fi est possible (plus de liaison via ethernet), à condition d'avoir renseigné correctement tous les paramètres du wi-fi bien sûr.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]