You are viewing a single comment's thread from:

RE: Raspberry Pi: Hotspot installieren

in #raspberrypi6 years ago (edited)

Ich bin auch nicht der Crack aber so hätte ich es verstanden. Lasse mich gerne berichtigen.

Installation der Pakete dnsmasq hostapd bridge-utils (-y automatisch mit Ja bestätigt)

apt-get install dnsmasq hostapd bridge-utils -y

Stoppen der Dienste/Units dnsmasq(DNS- und DHCP-Server) hostapd (Host access point daemon)

systemctl stop dnsmasq
systemctl stop hostapd

für die Console dhcpcd.conf im nano (editor) öffnen

nano /etc/dhcpcd.conf

wlan0 und eth0 bekommen vom dhcpcd keine IP mehr

denyinterfaces wlan0
denyinterfaces eth0

statische IP für wlan0 festlegen (IP/Gültigkeit)

interface wlan0
static ip_address=192.168.4.1/24

für die Console hostapd.conf im nano (editor) öffnen

nano /etc/hostapd/hostapd.conf

Einstellungen für wlan0

interface=wlan0
bridge=br0
ssid=Pi-Hotspot
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=1234567890
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

für die Console hostapd im nano (editor) öffnen

nano /etc/default/hostapd

DAEMON_CONF= (legt fest wo sich die Konfigurationsdatei befindet)

DAEMON_CONF="/etc/hostapd/hostapd.conf"

für die Console systctl.conf im nano (editor) öffnen

nano /etc/sysctl.conf

Portforwarding aktivieren, was wie wohin

net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sh -c "iptables-save > /etc/iptables.ipv4.nat"

iptables-restore < /etc/iptables.ipv4.nat

Erstellen einer Netzwerkbrücke br0, Weiterleitung auf eth0

brctl addbr br0
brctl addif br0 eth0

für die Console interfaces im nano (editor) öffnen

nano /etc/network/interfaces

Bridge setup

auto br0
iface br0 inet manual
bridge_ports eth0 wlan0