I am using a raspberry pi zero w.
I have settled up a connection to my router through wifi and have also an access point at the same time.
All works if my ssid that connect to my router works for wifi access, i have access to my AP as well and can connect to.
The problem is if my ssid cannot connect to my router for my wifi, then my AP doesn't shows up.
I have tried numerous things but can't figured it out.
Any help is very appreciate.
Here's my configuration:
cat /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
country=CA
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="my router"
psk="*******"
}
Code: Select all
interface=lo,RpiDiningRoom
no-dhcp-interface=lo,wlan0
bind-interfaces
server=8.8.8.8
domain-needed
bogus-priv
dhcp-range=192.168.34.50,192.168.34.150,12h
Code: Select all
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto RpiDiningRoom
auto wlan0
allow-hotplug RpiDiningRoom
iface RpiDiningRoom inet static
address 192.168.34.1
netmask 255.255.255.0
hostapd /etc/hostapd/hostapd.conf
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1
# fallback to static profile on eth0
#interface eth0
#fallback static_eth0
Code: Select all
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=RpiDiningRoom
driver=nl80211
ssid=RpiDiningRoom
hw_mode=g
channel=11
wmm_enabled=0
macaddr_acl=0
auth_algs=1
wpa=2
wpa_passphrase=********
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
Code: Select all
# Generated by iptables-save
*nat
:PREROUTING ACCEPT [1:78]
:INPUT ACCEPT [1:78]
:OUTPUT ACCEPT [2:142]
:POSTROUTING ACCEPT [2:142]
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8095
-A POSTROUTING -s 192.168.34.0/24 ! -d 192.168.34.0/24 -j MASQUERADE
COMMIT