logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 Re : Réseau » Paramétrage iptables pour domain.local avec avahi-daemon » 02-03-2017 19:14:42

Stevanovich
Bon voici un premier constat :
Dans /etc/hosts


127.0.0.1   localhost orangepizero
::1         localhost orangepizero ip6-localhost ip6-loopback
fe00::0     ip6-localnet
ff00::0     ip6-mcastprefix
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters
127.0.0.1   bid-serv5
127.0.0.1   bid-serv5.local
 




Fichier /etc/nsswitch.conf


# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

 




fichier /etc/avahi/avahi-daemon.conf


# See avahi-daemon.conf(5) for more information on this configuration
# file!

[server]
host-name=bid-serv2
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
allow-interfaces=wlan0,eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]
#disable-publishing=no
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
#publish-hinfo=yes
#publish-workstation=yes
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
#publish-a-on-ipv6=no

[reflector]
#enable-reflector=no
#reflect-ipv=no

 



Fichier


# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

# This file contains static ip address <-> host name mappings.  These
# can be useful to publish services on behalf of a non-avahi enabled
# device. Please bear in mind that host names are expected to be
# fully qualified domain names, i.e. ending in .local!

# See avahi.hosts(5) for more information on this configuration file!

# Examples:
# 192.168.0.1 router.local
# 2001::81:1 test.local
127.0.0.1 bid-serv3.local
#ip du wlan0
192.168.42.1 bid-serv4.local

 





Depuis mon android , connecté sur le eth0 : Rien
Depuis mon android , connecté sur le wlan0 : http - rien
ping bid-serv5.local résolu, pingé
ping bid-serv5 résolu, pingé

Depuis mon pc linux , http bid-serv2.local resolu.
ping bid-serv2.local résolu, pingé
ping bid-serv3.local résolu, pingé
ping bid-serv4.local résolu, NON pingé (plages différentes)



Depuis windows , rien, de rien

Je vais continuer mes recherches pour comprendre le mécanisme hostname , et pourquoi dans certains cas c'est hostname qui répond et pourquoi dans d'autres c'est avahi ...
Je pensais que c'était une histoire de ports ouverts 5353 pour avahi et 53 pour le dns .
iptables semble etre paramétré de façon identique pour ces ports.
Je reste désapointé scratchhead.gif

Mais .... je l'aurais !

#2 Re : Réseau » Paramétrage iptables pour domain.local avec avahi-daemon » 01-03-2017 00:05:47

Stevanovich
En me relisant  .... je me dis ... finalement c'est pas plus claire ...
J'arrive à pinger le hostname , mais uniquement par le phériphérique linux connecté sur le port eth0.
Je n'arrive pas à pinger ce qui est défini par avahi, mais c'est visible par l'outil angry ip scanner.
.....
Je vais au dodo .
A demain , et merci.

#3 Re : Réseau » Paramétrage iptables pour domain.local avec avahi-daemon » 28-02-2017 23:56:50

Stevanovich
@numa
Oui, la plus grand difficulté des néophytes (moi inclus) est de réussir à exprimer clairement et de façon limpide ce que l'on cherche à faire , en employant à tort des termes informatiques utilisé dans le language commun  ... ops.gif

Donc, J'ai installé une appli web sur mon Orange PI Zero (php + mysql) adressée sur le port 8080 .
j'y accède par http:\\192.168.0.53\controleparental:8080

Je souhaite, plutot que de tapper l'IP, y accedder par http:\\patrol.zone\controlparental:8080
Avec un hostname qui sera patrol.zone

Pourquoi ?
Car, je souhaite effectuer des essais un peu partout, donc j'emmène mon ptit bidule chez pierre paul jacques,
je le branche sur un port ethernet, et je sais que j'y accès par :

http:\\patrol.zone\controlparental:8080


Maintenant, pourquoi mon bazard avec le wifi ?
Pareil, j'ai créér un wifi avec un mot de passe à moi, je me branche sur la box de mon pote en ethernet , et je fais ce que je veux, avec son accord, bien entendu big_smile
Mes enfants ont tous internet , et je me prends la tete sur ce qu'ils pourront voir ...ou acceder .

Donc, dans avahi j'ai modifié ça :


[server]
host-name=patrol
domain-name=zone
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
allow-interfaces=eth0,wlan0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]
#disable-publishing=no
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
#publish-hinfo=yes
#publish-workstation=yes
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
#publish-a-on-ipv6=no

[reflector]
enable-reflector=no
reflect-ipv=no

[rlimits]
#rlimit-as=
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=768
rlimit-stack=4194304
rlimit-nproc=3

 



J'ai entré ça dans iptables:


  # reset firewall rules
  iptables -F; iptables -X; iptables -P INPUT DROP; iptables -P OUTPUT ACCEPT; iptables -P FORWARD DROP
  # allow loopback
  iptables -A INPUT -i lo -j ACCEPT; iptables -A OUTPUT -o lo -j ACCEPT
  # allow already established connections on eth0 (useful for SSH)
  iptables -A INPUT -i $ETH_IN -m state --state RELATED,ESTABLISHED -j ACCEPT
  # Allow ping on $ETH_IN & $WLAN
  iptables -A INPUT -i $ETH_IN -p icmp -m icmp --icmp-type 8 -j ACCEPT
  iptables -A INPUT -i $WLAN -p icmp -m icmp --icmp-type 8 -j ACCEPT
  iptables -A FORWARD -i $WLAN -o $ETH_IN -p icmp -m icmp --icmp-type 8 -j ACCEPT

  # allow SSH in, on $ETH_IN  & $WLAN
  iptables -A INPUT -i $ETH_IN -p tcp -m tcp --dport 22 -j ACCEPT
  iptables -A INPUT -i $WLAN -p tcp -m tcp --dport 22 -j ACCEPT


  # allow HTTP in, on $ETH_IN  & WLAN
  iptables -A INPUT -i $ETH_IN -p tcp -m tcp --dport 80 -j ACCEPT
  iptables -A INPUT -i $WLAN -p tcp -m tcp --dport 80 -j ACCEPT

  # allow DNS in, on $WLAN
  iptables -A INPUT -i $WLAN -p udp -m udp --dport 53 -j ACCEPT
  #iptables -A INPUT -i $WLAN -p tcp -m tcp --dport 53 -j ACCEPT
  iptables -A INPUT -i $ETH_IN -p udp -m udp --dport 53 -j ACCEPT
  #iptables -A INPUT -i $ETH_IN -p tcp -m tcp --dport 53 -j ACCEPT



  # allow DHCP in, on $WLAN
  iptables -A INPUT -i $WLAN -p udp -m udp --dport 67 -j ACCEPT
  # allow patrolzone in, on $WLAN & ETH
  iptables -A INPUT -i $WLAN -p tcp -m tcp --dport 8080 -j ACCEPT
  iptables -A INPUT -i $ETH_IN -p tcp -m tcp --dport 8080 -j ACCEPT

  # allow Avahi-Deamon in, on $WLAN & ETH
  iptables -A INPUT -i $WLAN -p udp -m udp --dport 5353 -j ACCEPT
  iptables -A INPUT -i $ETH_IN -p udp -m udp --dport 5353 -j ACCEPT


  # packet forwarding
  sysctl net.ipv4.ip_forward=1
  iptables -t nat -A POSTROUTING -o $ETH_IN -j MASQUERADE
  iptables -A FORWARD -i $ETH_IN -o $WLAN -m state --state RELATED,ESTABLISHED -j ACCEPT

  # allow HTTP and HTTPS to be forwarded
  iptables -A FORWARD -i $WLAN -o $ETH_IN -p tcp -m tcp --dport 80 -j ACCEPT
  iptables -A FORWARD -i $WLAN -o $ETH_IN -p tcp -m tcp --dport 443 -j ACCEPT

 




Donc, je ping patrol.zone pour tester .... et ça ping pas scratchhead.gif

Par contre www.google.fr fonctionne sur wlan0  et eth0 (ben oui lui c'est normal hi hi hi )
Et donc patrolzone.local (Qui sera patrol.zone) ,le ping fonctionne uniquement sur le eth0 et depuis un pc linux, pas android, et pas windows ...
patrolezone.local est défini par hostname (pour l'instant)

L'outil Angry IP Scanner affiche correctement "patrol.zone" ... mais pas patrolzone.local ... crash.gif

Merci pour votre patience mrgreen.gif

#4 Re : Réseau » Paramétrage iptables pour domain.local avec avahi-daemon » 28-02-2017 21:11:10

Stevanovich
@raleur
@numa

Merci à vous, je me suis surement mal exprimé, ou je n'ai pas bien compris les réponses, (ou les deux lol )
@numa : Oui, Je précise que le domain.local se situe sur le PI
Edit:J'ai créé un domain.local sur mon Orange Pi Zero : domain.local, que je veux rendre accessible depuis le WLAN et sur le ETH0

Je trouverai étrange que l'on puisse pinger domain.local sur ETH0 , mais pas sur WLAN0 ... ne faudrait-il pas mettre lo dans iptables ?

Merci

#5 Réseau » Paramétrage iptables pour domain.local avec avahi-daemon » 28-02-2017 12:30:47

Stevanovich
Réponses : 8
Bonjour,
Exposé de mon problème :
Matériel : Orange Pi zero
J'ai créé un hotspot wifi sans pont réseau . (iptables et dnsmasq)

ETH0 est connecté au réseau et à ma box "freebox" (ip dhcp)
WLAN0 me permet de connecter mes téléphones et autres périphériques avec leur propres plages IP.
Edit:J'ai créé un domain.local sur mon Orange Pi Zero : domain.local, que je veux rendre accessible depuis le WLAN et sur le ETH0


Mon PC1 connecté sur le LAN (ETH) accède bien à domain.local
Mon PC2 connecté au WLAN0 n'accède pas à domain.local

J'ai autorisé le port 5353 suivant les règles suivantes:


# allow AVAHI in, on $WLAN
iptables -A INPUT -i $WLAN0 -p udp -m udp --dport 5353 -j ACCEPT
iptables -A INPUT -i $ETH0 -p udp -m udp --dport 5353 -j ACCEPT
 



Aurais-je oublié quelque chose ?
Quelles sont les règles à établir pour accéder à mon domain.local depuis tous les ports ETH et WLAN ?

Merci à vous !

#6 Re : Réseau » HotSpot armbian (Orange Pi Zero) » 28-02-2017 10:08:18

Stevanovich
@numa
Merci pour toutes ces informations.
Je finis la mise en place sous forme de script (mafois très fonctionnel), puis je me lance dans le  paramétrage en dur .
Mes deux problèmes actuels sont :
1 - pourquoi dois-je lancer ces commandes avant de pouvoir mettre en place hostapd ? :


systemctl stop wpa_supplicant
systemctl disable wpa_supplicant
nmcli radio wifi off
rfkill unblock wlan
 



2 - problème iptable avec avahi-daemon , ne passe pas, je fais un autre post pour ce sujet.

#7 Re : Réseau » HotSpot armbian (Orange Pi Zero) » 26-02-2017 23:18:20

Stevanovich
Bonsoir numa,
Merci pour le lien vers le tuto .
Je le garde en prévision pour mon Pi3 (j'en ai aussi un wink )

Je pense avoir trouvé pourquoi je perdais mon Opiz lors du reboot, il me manquait une règle pour le port 80 et 22 (SSH)
Je vais supprimer toute ma partie destruction dans le rc.local pour voir ce qu'il se passe au reboot big_smile

Concernant le comparatif avec ce que tu m'a envoyé pour le Pi3 , ce qui va etre compliqué pour moi, sera justement de comparer les deux solutions.

Ce qui ne fonctionne pas (oops ce que je n'arrive pas à faire fonctionner car je pige kedal ) :
- pont réseau br0
- dhcp

Visiblement , tout passe avec dnsmask et iptable ....

Suite au prochain reboot .... tongue

#8 Réseau » HotSpot armbian (Orange Pi Zero) » 26-02-2017 18:13:00

Stevanovich
Réponses : 5
Bonjour à tous .

Après moultes essais , et disons le , à bout de souffle dans mes reboot et mes re-essais , je me retourne vers vous pour , disons le , m'éviter quelques séances de psychothérapie ....

Le matériel : dans le titre Orange Pi Zero .http://linux-sunxi.org/Xunlong_Orange_Pi_Zero

Ce que je veux faire : Avoir un point d'accès wifi me permettant de connecter des périphériques (si si !!) ayant un accès internet MAIS n'étant pas sur le broadcast de ma box (hum hum)

Ce que j'ai essayé : tout ce qui tourne autour de hostapd , network interface ...
Ce qui fonctionne :

Ce script


#!/bin/bash
#
# hotspot2014.sh
#
# Wireless Access Point (SoftAP)
#
# by AgentSteel for Debian-fr.org
# 24/Apr/2014
#
# USE AT YOUR OWN RISK!
#
# Tested on Debian Wheezy (7.0)
#
# Two modes of operation :
#  - with a network bridge (see BRIDGE variable) for transparent connection sharing (no DNS logging...)
#   or
#  - with dnsmasq and iptables for packet forwarding between network interfaces (DNS logging)
#
# Run this script as root.
# This script will likely stop currently running network connections.
# You may also need to disable your local firewall.
#
# Required : dhclient, hostapd, firmware-realtek (non-free)
# Optional : bridge-utils, dnsmasq

# Adjust your settings here
WLAN="wlan0"

systemctl stop wpa_supplicant # Rajouté
systemctl disable wpa_supplicant  # Rajouté
nmcli radio wifi off # Rajouté
rfkill unblock wlan # Rajouté

# the IP address of your SoftAP interface (if using dnsmasq)
# and the corresponding IP range for your SoftAP clients (if using dnsmasq)
WLAN_IP="192.168.9.1"
DHCP_RANGE="192.168.9.2,192.168.9.254"

# your SoftAP SSID, channel and passphrase
SSID="ODHF-Serveur-1"  # bidon
CHANNEL=3
PASSPHRASE="6DS4FfdVSèDS" # pareil bidon

# Set your desired bridge interface name here
MY_BRIDGE="ap-br0"
# and the other network interface for bridge
IF_BRIDGE="eth0"

# Uncomment to use bridging, or comment to use dnsmasq/iptables
#BRIDGE="bridge=$MY_BRIDGE"

# (input) network interface when using dnsmasq/iptables
IF_IN="eth0"

# Set to "-d" for hostapd debugging output
# or "-B" (background mode) for default operation
HOSTAPD_OPT="-B"

# global exit code for script (0 = no error)
ret=0

# function : check for required software
function checklist()
 {
  local ret=0
  # check if running as root
  [[ $EUID -ne 0 ]] && { echo "You must be root to run this script!"; ret=1; }
  if [[ -n "$BRIDGE" ]]; then
   # when using a bridge, ensure brctl is found
   hash brctl >/dev/null 2>&1 || { echo "brctl not found, please install bridge-utils package."; ret=1; }
  else
   # not using a bridge, we need dnsmasq and iptables
   hash dnsmasq >/dev/null 2>&1 || { echo "dnsmasq not found, please install dnsmasq package."; ret=1; }
   hash iptables >/dev/null 2>&1 || { echo "iptables not found, please install iptables package."; ret=1; }
  fi
  hash hostapd >/dev/null 2>&1 || { echo "hostapd not found, please install hostapd package."; ret=1; }
  return $ret
 }

# function : cleanup the mess when exiting
function cleanup()


{
# clean up a bit (the dirty way!)
 sysctl net.ipv4.ip_forward=0
 iptables-restore <iptables.save && echo "iptables rules restored."
 killall hostapd >/dev/null 2>&1 && echo "hostapd killed."
 [[ -f "$TMP_CONF" ]] && rm "$TMP_CONF"
 killall dnsmasq >/dev/null 2>&1 && echo "dnsmasq killed."
 killall dhclient >/dev/null 2>&1 && echo "dhclient killed."
 ifconfig "$MY_BRIDGE" down >/dev/null 2>&1
 sleep 2
 brctl delif "$MY_BRIDGE" "$IF_BRIDGE" >/dev/null 2>&1
 brctl delif "$MY_BRIDGE" "$WLAN" >/dev/null 2>&1
 brctl delbr "$MY_BRIDGE" >/dev/null 2>&1 && echo "bridge $MY_BRIDGE destroyed."
}

 # Main program

 # check for requirements, abort eventually
 checklist || exit 1

 # trap for cleanup
 trap cleanup SIGINT SIGTERM

 # First, disable any network management software
 echo -n ">>> Trying to disable any network management software... "
 service network-manager stop >/dev/null 2>&1
 service wicd stop >/dev/null 2>&1
 echo "OK."

 # If not using a bridge, start dnsmasq (dns and dhcp) server
 if [[ -z "$BRIDGE" ]]; then
  killall dnsmasq >/dev/null 2>&1
  # TODO : additional hosts file
  dnsmasq --interface "$WLAN" --dhcp-range="$DHCP_RANGE" --log-queries || { echo "dnsmasq failed to start!"; exit 1; }
  # assign IP to the wireless interface
  ifconfig "$WLAN" "$WLAN_IP"

  # now you could start a webserver to share some files (eg. gatling lightweight www server)
  # and allow your SoftAP clients to go to http://$WLAN_IP/

  # save current firewall rules
  iptables-save >iptables.save && echo ">>> Current firewall configuration saved."
  # reset firewall rules
  iptables -F; iptables -X; iptables -P INPUT DROP; iptables -P OUTPUT ACCEPT; iptables -P FORWARD DROP
  # allow loopback
  iptables -A INPUT -i lo -j ACCEPT; iptables -A OUTPUT -o lo -j ACCEPT
  # allow already established connections on eth0 (useful for SSH)
  iptables -A INPUT -i $IF_IN -m state --state RELATED,ESTABLISHED -j ACCEPT
  # Allow ping on $IF_IN
  iptables -A INPUT -i $IF_IN -p icmp -m icmp --icmp-type 8 -j ACCEPT
  # allow SSH in, on $IF_IN only
  #iptables -A INPUT -i $IF_IN -p tcp -m tcp --dport 22 -j ACCEPT
  # allow HTTP in, on $IF_IN only (hotspot's web server)
  #iptables -A INPUT -i $IF_IN -p tcp -m tcp --dport 80 -j ACCEPT
  # allow DNS in, on $WLAN
  iptables -A INPUT -i $WLAN -p udp -m udp --dport 53 -j ACCEPT
  # allow DHCP in, on $WLAN
  iptables -A INPUT -i $WLAN -p udp -m udp --dport 67 -j ACCEPT
  # packet forwarding
  sysctl net.ipv4.ip_forward=1
  iptables -t nat -A POSTROUTING -o $IF_IN -j MASQUERADE
  iptables -A FORWARD -i $IF_IN -o $WLAN -m state --state RELATED,ESTABLISHED -j ACCEPT
  # allow HTTP and HTTPS to be forwarded
  iptables -A FORWARD -i $WLAN -o $IF_IN -p tcp -m tcp --dport 80 -j ACCEPT
  iptables -A FORWARD -i $WLAN -o $IF_IN -p tcp -m tcp --dport 443 -j ACCEPT
  #iptables -A FORWARD -i $WLAN -o $IF_IN -p tcp -m tcp --dport 8080 -j ACCEPT
  # uncomment below to allow SSH to be forwarded
  #iptables -A FORWARD -i $WLAN -o $IF_IN -p tcp -m tcp --dport 22 -j ACCEPT

  # (everything else will be forbidden)

 else
  # we create a new network bridge to share network (and internet) access
  brctl addbr "$MY_BRIDGE"
  brctl addif "$MY_BRIDGE" "$IF_BRIDGE"
  # $WLAN interface will be added later to the bridge
 fi

 # create a temporary file with our hostapd conf
 # (adapted from Realtek's examples)
 # (see proprietary driver package from Realtek's website)
 TMP_CONF=$(mktemp)
 if [[ -z "$TMP_CONF" ]]; then
  echo "Error creating hostapd temporary configuration file!"
  ret=1
 else
  # read-only for root
  chmod 600 "$TMP_CONF"
  cat >"$TMP_CONF" <<EOF
# hostapd configuration starts here
#ctrl_interface=/usr/sbin/hostapd
#ctrl_interface_group=0
interface=$WLAN
$BRIDGE
ssid=$SSID
channel=$CHANNEL
beacon_int=100
# (hardware limit for some wireless chipsets)
max_num_sta=250
hw_mode=g
# we use 802.11n (wifi N)
ieee80211n=1
wme_enabled=1
#ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
# We use WPA2 of course
wpa=2
wpa_passphrase=$PASSPHRASE
wpa_key_mgmt=WPA-PSK
wpa_key_mgmt=WPA-PSK
# Note: TKIP not supported with RTL8188RU chip!
wpa_pairwise=CCMP
wpa_group_rekey=86400
# other settings
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
#dump_file=/tmp/hostapd.dump
dtim_period=2
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3


wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
EOF


  echo ">>> Starting hostapd."
  # start hostapd
  if ! hostapd $HOSTAPD_OPT "$TMP_CONF"; then
   echo "hostapd failed to start."
   ret=1
  else
   # finally get an IP address for the bridge, only when using a bridge (assume we have a dhcp server in our LAN)
   [[ -n "$BRIDGE" ]] && dhclient "$MY_BRIDGE" && echo ">>> Network bridge $MY_BRIDGE is up."
   # TODO : handle dhclient failure
   [[ -z "$BRIDGE" ]] && echo ">>> Using dnsmasq and iptables."

   iwconfig $WLAN
   echo ">>> SoftAP is up and running!            SSID = $SSID"
   echo ">>> Hit ctrl-c to stop."
   # display syslog to see what happens
   tail -ff /var/log/syslog
  fi
 fi

cleanup
echo -e "\n>>> SoftAP terminated!"
exit $ret
 



J'y ai rejouté ces 4 ligne :


systemctl stop wpa_supplicant # Rajouté
systemctl disable wpa_supplicant  # Rajouté
nmcli radio wifi off # Rajouté
rfkill unblock wlan # Rajouté
 



Et bien, vous me direz, "Ben alors ça fonctionne ! c'est quoi qu'il veux le monsieur ?"

Et bien, c'est bien ça le problème :
1 - C'est un script
2 - ça démarre pas au boot.
3 - Quand je reboot sans quitter le shell .... je rame pour refaire démarrer le truc (ça redémarre mais plus d'IP)

Je suis obligé de démonter la carte sd, la montée sur un ubuntu, et de modifier tous les paramètres pour y avoir accès en ssh , la galère.
je joue dans /etc/rc.local pour l'instant ,


sysctl net.ipv4.ip_forward=0
iptables-restore </home/user/iptables.save
killall hostapd
killall dnsmasq
killall dhclient
ifconfig ap-br0 down
brctl delif ap-br0 eth0
brctl delif ap-br0 wlan0
brctl delbr ap-br0
 



Pouvez vous me filer un coup de main pour savoir avec certitude ou intervenir  pour tout désactiver au démarrage ... svp ( ben si quand même )

Bisous à vous tous et merci.

Pied de page des forums

Propulsé par FluxBB