Cannot ping module (hostapd)

Having sucessfully configured hostapd, the imx6 module shows 192.168.157.1 for wlan0.

I am able to connect sucessfully from my desktop computer

The dhcpd on the module hands an address of 192.168.157.253 to my desktop.

Ping shows no connection however:

steve@trabajonuevo ~ $ ping 192.168.157.1
PING 192.168.157.1 (192.168.157.1) 56(84) bytes of data.
From 192.168.157.253 icmp_seq=1 Destination Host Unreachable
From 192.168.157.253 icmp_seq=2 Destination Host Unreachable
From 192.168.157.253 icmp_seq=3 Destination Host Unreachable

— 192.168.157.1 ping statistics —
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3078ms

steve@trabajonuevo ~ $ traceroute 192.168.157.1
traceroute to 192.168.157.1 (192.168.157.1), 30 hops max, 60 byte packets
 1  192.168.157.253 (192.168.157.253)  3064.492 ms !H  3064.432 ms !H  3064.427 ms !H

So, zero actual connectivity…any suggestions?

Update: I can ping my desktop successfully from the imx6!

So ping 192.168.157.1 fails from my desktop (“destination host unreachable”), but ping 192.168.157.253 works great from the imx6!

I also disabled the wired ethernet interfaces on both the desktop and imx6 which failed to make a difference.

One-way connectivity: it’s a feature, not a bug :wink:

I assume you did it e.g. as follows:

Precisely. hostapd is working. my desktop computer shows the wifi as connected successfully. dhcp hands an IP on the correct subnet to my desktop. I can ping the desktop from the imx6, but I cannot ping the imx6 from the desktop.

Please share routing tables from both the access point and the station.

steve@trabajonuevo ~ $ netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         tus-router.zong 0.0.0.0         UG        0 0          0 enp0s25
default         192.168.157.1   0.0.0.0         UG        0 0          0 wlp3s0
link-local      *               255.255.0.0     U         0 0          0 enp0s25
192.168.157.0   *               255.255.255.0   U         0 0          0 wlp3s0
192.168.220.0   tus-router.zong 255.255.255.0   UG        0 0          0 enp0s25
192.168.221.0   tus-router.zong 255.255.255.0   UG        0 0          0 enp0s25
192.168.222.0   *               255.255.255.0   U         0 0          0 enp0s25
192.168.223.0   tus-router.zong 255.255.255.0   UG        0 0          0 enp0s25

sh-4.4# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.157.0   *               255.255.255.0   U         0 0          0 wlan0
192.168.157.0   *               255.255.255.0   U         0 0          0 eth0

what I’m expecting to see also (must be cause usb cable is unplugged)

10.157.1.0   *               255.255.255.0   U         0 0          0 usb0

what I actually see once I plug in the usb cable:

sh-4.4# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.157.0   *               255.255.255.0   U         0 0          0 wlan0
192.168.157.0   *               255.255.255.0   U         0 0          0 eth0
192.168.157.0   *               255.255.255.0   U         0 0          0 usb0

I think the systemctl dhcpd is too stupid and it’s trying to hand out leases for all three i/f’s even though it’s spec’d seperately in /lib/systemd/network/rndis.network and /lib/systemd/network/hostapd.network (and /lib/systemd/network/eth0.network doesn’t exist).

The config files I just mentioned specify different subnets in each file, but eth0 & usb0 are appearing on the hostapd.network subnet!

rndis.network:

[Match]
# We use type since device name depends on Kernel version
# udevadm info --query=property /sys/class/net/usb0
Type=gadget

[Network]
Address=10.157.1.1/24
Gateway=
DHCPServer=yes

[DHCPServer]
EmitDNS=no
EmitNTP=no
EmitRouter=no
EmitTimezone=no

hostapd.network:

[Match]
Name=wlan0
[Network]
Address=192.168.157.1/24
DHCPServer=yes

You may consider limiting the scope of your address resp.
route sections which defaults to global and not link only!