0

I am working on an embedded system running Yocto. I created an access point using the following commands:

iw dev wlan0 interface add wlan1 type __ap
ifconfig wlan1 hw ether 00:25:ca:07:0d:a6
ifconfig wlan1 192.168.3.1 up 
hostapd /etc/hostapd.conf -B
udhcpd /etc/udhcpd.conf 

I can see the created wifi network and I can connect to it with my Ubuntu PC. An IP is correctly assigned. However, I cannot ping the Yocto board from my PC, while I can ping the PC from the board. I also noticed that if I run the ping command from the PC and then I run the same command from the board, the ping from the PC starts working as soon as the ping from the board starts.

This is the content of /etc/hostapd.conf:

interface=wlan1
driver=nl80211
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=3
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=softAP
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Content of /etc/udhcpd.conf:

start 192.168.3.10
end   192.168.3.100

# The interface that udhcpd will use

interface   wlan1   #default: eth0

Output of ip route on the board:

192.168.3.0/24 dev wlan1 proto kernel scope link src 192.168.3.1

Output of ip route on the PC:

192.168.3.0/24 dev wlx000f005d7551  proto kernel  scope link  src 192.168.3.10  metric 600 
192.168.178.0/24 dev enp14s0  proto kernel  scope link  src 192.168.178.84  metric 100 

An answer here suggests to limit the scope of the address, but I cannot find the network files specified in this page. How can I fix this problem?

3
  • Sounds like a routing problem. Does the PC have another interface besides wireless? If yes, what is the address and subnet on this other interface and does it overlap with the wireless subnet? What is the output of ip route? The PC may be sending the ICMP packets through the wrong interface but responding through the same interface it comes in. You can also try specifying the interface with ping -I wlan1 to test this hypothesis. Commented Apr 19, 2021 at 8:48
  • I tried to specify the interface in the ping command but the problem remains. I also tested the issue with a smartphone connected only to the AP. I edited my question ith the outpute of ip route command
    – firion
    Commented Apr 19, 2021 at 9:15
  • OK. I don't think it is routing, then. The next most likely culprits are firewalls. I suggest you supplement your question also with the firewall tables of the machines involved, if applicable. Commented Apr 19, 2021 at 14:44

1 Answer 1

1

After some trials I fixed the problem by removing the line

ifconfig wlan1 hw ether 00:25:ca:07:0d:a6

You must log in to answer this question.

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