Goal is for clients to connect through Pi4 AP to the WAN. The Pi4 is inside the LAN and wire connected to a router LAN port.
After much effort a client can now connect to the Pi4 AP but cannot ping the Pi4 wlan0 interface at 192.168.0.3 (which I had thought would work at this point).
Am surprised that ping on the Pi4 to a client works with:
ping 192.168.0.104 -I wlan0
PING 192.168.0.104 (192.168.0.104) from 192.168.0.3 wlan0:
64 bytes from 192.168.0.104: icmp_seq=1 ttl=64 time=93.2 ms
A client wireless connected setup shows default route as 192.168.0.1 and DNS as 192.168.0.3
Clients are getting the correct ip address as per MAC addresses in the DNSmasq setup.
Here's the setup:
/etc/dhcpcd.conf: (ifconfig confirms the interfaces settings)
interface eth0
static ip_address=192.168.0.2/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
noipv6
interface wlan0
static ip_address=192.168.0.3/24
noipv6
nohook wpa_supplicant
/etc/network/interfaces:
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet manual
/etc/wpa_supplicant/wpa_supplicant.conf: Nothing added
/etc/hostapd/hostapd.conf:
interface=wlan0
driver=nl80211
ssid=MyAPtest
wpa_passphrase=mytest
hw_mode=g
channel=6
wmm_enabled=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
/etc/default/hostapd:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
/etc/sysctl.conf:
net.ipv4.ip_forward=1
Tried the following that didn't do anything (and not surprised):
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT