I would like to create a WiFi Hotspot using the Raspberry Pi. It does not have to provide a internet connection to the devices which are connected. But the raspberry Pi should still be connected to the WiFi so that it can be in the internet. I followed a tutorial to create a hotspot which works well. Unfortunately I cannot connect to the internet anymore with the raspberry pi. So is it possible that I create a "local" hotspot without internet and connect at the same time with my raspberry pi to a wifi network or is it simply impossible?
sudo nano /etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.1.1/24
sudo systemctl restart dhcpcd
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf_alt
sudo nano /etc/dnsmasq.conf
interface=wlan0
DHCP-Server nicht aktiv für bestehendes Netzwerk
no-dhcp-interface=eth0
IPv4-Adressbereich und Lease-Time
dhcp-range=192.168.1.100,192.168.1.200,255.255.255.0,24h
DNS
dhcp-option=option:dns-server,192.168.1.1
dnsmasq --test -C /etc/dnsmasq.conf
sudo systemctl restart dnsmasq
sudo systemctl status dnsmasq
sudo systemctl enable dnsmasq
sudo nano /etc/hostapd/hostapd.conf
WLAN-Router-Betrieb
Schnittstelle und Treiber
interface=wlan0
#driver=nl80211
WLAN-Konfiguration
ssid=WLANrouter
channel=1
hw_mode=g
ieee80211n=1
ieee80211d=1
country_code=DE
wmm_enabled=1
WLAN-Verschlüsselung
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=test
sudo chmod 600 /etc/hostapd/hostapd.conf
sudo hostapd -dd /etc/hostapd/hostapd.conf
sudo nano /etc/default/hostapd
Adding
RUN_DAEMON=yes
DAEMON_CONF="/etc/hostapd/hostapd.conf"
sudo systemctl unmask hostapd
sudo systemctl start hostapd
sudo systemctl enable hostapd
sudo nano /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo nano /etc/rc.local
#Adding
iptables-restore < /etc/iptables.ipv4.nat
sudo reboot