0

I am working on an embedded Linux system (kernel-5.10.24), there is a RTL8723 WIFI module in my system.

Now I configured the target board as WIFI AP with hostapd/udhcpd/dnsmasq.

The hostapd.conf is.

interface=wlan0
driver=nl80211
ssid=TestWIFIAP
channel=1
hw_mode=g
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0

The udhcpd.conf is

start           192.168.0.20     #default: 192.168.0.20
end             192.168.0.254   #default: 192.168.0.254

# The interface that udhcpd will use
interface       wlan0           #default: eth0
remaining yes
......
opt       dns       8.8.8.8 8.8.4.4
opt       subnet    255.255.255.0
opt       router    192.168.0.1

The wlan0 in the system is configured with 192.168.0.1

After starting hostapd/udhcpd, I can connect my Windows PC to the AP, the PC is allocated an IP of 192.168.0.20.

I can ping the AP's IP 192.168.0.1 from PC, but I cannot ping my PC's IP 192.168.0.20 from within the AP.

The networking info in AP is.

# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3744 (3.6 KiB)  TX bytes:3744 (3.6 KiB)

wlan0     Link encap:Ethernet  HWaddr 30:95:87:XX:XX:XX
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15966 errors:0 dropped:64 overruns:0 frame:0
          TX packets:7603 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20882819 (19.9 MiB)  TX bytes:647826 (632.6 KiB)

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0

Then I started to run iperf -s in the AP, and iperf -c 192.168.0.1 -t 10 from my PC, it worked well.
But it failed if I ran iperf -c 192.168.0.20 -t 10 in the AP.

I googled and found similar problems, but no solid solution/explanation of it.

The firewall settings in Linux AP is as follows,

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

And the arping -I wlan0 192.168.0.20 can get the MAC of the Windows PC. But ping from Linux AP to Windows PC still failed.

6
  • If they can communicate one way (but not the other) that means routes are ok and anything below routes so layer 2 is ok too. You should look for a firewall on the client instead. As the PC is Windows there's no solution for this on this Unix/Linux SE.
    – A.B
    Commented Jan 17 at 17:53
  • You can install on the Linux AP the command arping (usually from iputils-arping / iputils package/sources, rather than from arping package) and run arping 192.168.0.20: even if ICMP pings are blocked, usually ARP sortof pings are not.
    – A.B
    Commented Jan 17 at 18:00
  • In the Windows, I have WSL2 Linux installed. I can ping the AP from Windows command line and from WSL2 Linux. I will install arping in Linux AP, and try it.
    – wangt13
    Commented Jan 17 at 23:30
  • I tried arping -I wlan0 PC's IP, it worked. I updated the question with iptables settings, there should be NO firewall for outgoing ICMP, but I don't know why ping from the AP is still failed.
    – wangt13
    Commented Jan 18 at 0:11
  • The problem is on the Windows system.
    – A.B
    Commented Jan 18 at 1:03

1 Answer 1

0

I did one more test, and got the answer.

I set the Linux board as host mode, and connected it to an WIFI AP in office, it got an IP of 192.168.95.77.
Then I connected the Windows PC to the same WIFI AP, its IP is 192.168.95.96.

I can ping from the Windows PC to the Linux board, but failed to ping from Linux board to the Windows PC, the same problem as I posted in the question.

So I checked with IT team, and be confirmed that the Windows PC is configured with firewall to reject input ping on the 192.168 subnetwork.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .