Guten Abend,
ich möchte das onboard WLAN eines Raspi 3B oder Zero W nutzen, um den Raspi gleichzeitig mit einem Router über WLAN zu verbinden als auch einen AP bereit zu stellen. Ich halte mich an diese Anleitung: http://imti.co/post/145442415…wifi-station-ap. Ich habe ein gestern heruntergeladenes Raspbian Stretch Light.
Über WLAN habe ich die Pakete hostapd und dnsmasq heruntergeladen, aber nachdem ich alle Konfigs anpasse und neu starte, geht "nichts mehr". Ich kann z.B. 8.8.8.8 nicht anpingen, ein AP ist in der Liste verfügbarer WLANs nicht zu finden.
Hoffentlich kann mir jemand helfen!
Noch ein paar Ausgaben, gerne reiche ich nach, falls etwas fehlt:
Code
ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 44 bytes 4238 (4.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 44 bytes 4238 (4.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
uap0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::ba27:ebff:fe38:8926 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:38:89:26 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7 bytes 808 (808.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.1.17 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::ba27:ebff:fe38:8926 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:38:89:26 txqueuelen 1000 (Ethernet)
RX packets 6 bytes 1098 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 28 bytes 4981 (4.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Alles anzeigen
Code
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 uap0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
Code
systemctl status hostapd.service
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
Loaded: loaded (/etc/init.d/hostapd; generated; vendor preset: enabled)
Active: active (running) since Tue 2017-10-17 16:46:40 UTC; 1min 9s ago
Docs: man:systemd-sysv-generator(8)
Process: 566 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/hostapd.service
└─613 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf
Oct 17 16:46:40 temp-logger-pi systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...
Oct 17 16:46:40 temp-logger-pi hostapd[566]: Starting advanced IEEE 802.11 management: hostapd.
Oct 17 16:46:40 temp-logger-pi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.
Alles anzeigen
Code
systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-10-17 16:46:40 UTC; 1min 1s ago
Process: 602 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
Process: 599 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
Oct 17 16:46:40 temp-logger-pi systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Oct 17 16:46:40 temp-logger-pi dnsmasq[599]: dnsmasq: syntax check OK.
Oct 17 16:46:40 temp-logger-pi dnsmasq[602]: dnsmasq: unknown interface uap0
Oct 17 16:46:40 temp-logger-pi systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
Oct 17 16:46:40 temp-logger-pi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Oct 17 16:46:40 temp-logger-pi systemd[1]: dnsmasq.service: Unit entered failed state.
Oct 17 16:46:40 temp-logger-pi systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Alles anzeigen
Code
systemctl status rc-local.service
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)
Drop-In: /lib/systemd/system/rc-local.service.d
└─debian.conf
/etc/systemd/system/rc-local.service.d
└─ttyoutput.conf
Active: failed (Result: exit-code) since Tue 2017-10-17 16:46:41 UTC; 42s ago
Process: 568 ExecStart=/etc/rc.local start (code=exited, status=1/FAILURE)
Oct 17 16:46:40 temp-logger-pi systemd[1]: Starting /etc/rc.local Compatibility...
Oct 17 16:46:40 temp-logger-pi rc.local[568]: Job for dnsmasq.service failed because the control process exited with error code.
Oct 17 16:46:40 temp-logger-pi rc.local[568]: See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
Oct 17 16:46:40 temp-logger-pi rc.local[568]: RTNETLINK answers: Invalid argument
Oct 17 16:46:40 temp-logger-pi rc.local[568]: ifup: failed to bring up uap0
Oct 17 16:46:41 temp-logger-pi systemd[1]: rc-local.service: Control process exited, code=exited status=1
Oct 17 16:46:41 temp-logger-pi systemd[1]: Failed to start /etc/rc.local Compatibility.
Oct 17 16:46:41 temp-logger-pi systemd[1]: rc-local.service: Unit entered failed state.
Oct 17 16:46:41 temp-logger-pi systemd[1]: rc-local.service: Failed with result 'exit-code'.
Alles anzeigen
Code
/etc/default/hostapd
# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF="/etc/hostapd/hostapd.conf"
# Additional daemon options to be appended to hostapd command:-
# -d show more debug messages (-dd for even more)
# -K include key data in debug messages
# -t include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""
Alles anzeigen
Code
/etc/wpa_supplicant/wpa_supplicant.conf
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="MeineSSIDhier"
psk="passworthier"
key_mgmt=WPA-PSK
}
Code
/etc/dnsmasq.conf
interface=lo,uap0
no-dhcp-interface=lo,wlan0
bind-interfaces
server=8.8.8.8
domain-needed
bogus-priv
dhcp-range=10.0.0.50,10.0.0.150,12h
Code
/etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto uap0
iface uap0 inet static
address 10.0.0.1
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1
Alles anzeigen
Code
/home/pi/startup.sh
#!/bin/bash
iw dev wlan0 interface add uap0 type __ap
service dnsmasq restart
sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 ! -d 10.0.0.0/24 -j MASQUERADE
ifup uap0
hostapd /etc/hostapd/hostapd.conf
Code
/etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/bin/bash /home/pi/startup.sh
exit 0
Alles anzeigen