0

I'm using a Linux machine with WiFi hotspot to test the WiFi stack of an embedded device. For context, the embedded device is designed to send and receive encrypted packets to/from a remote server.

To complete a specific secure test, I need to find a way to return tcp and udp packets sent by the embedded device through the WiFi hotspot back to the embedded device.

sudo iptables -t nat -A PREROUTING -s ${embedded_device_ip} -j DNAT --to-destination ${embedded_device_ip}

After using the above command, the embedded device successfully connects to the AP but cannot receive responses from the remote server, as expected. However, no returning packets are being received at the embedded device.

I've been successfully using iptables to control the embedded device's overall access to the AP so far, but I suspect that the NAT-affected packets may be being dropped instead of returned if the rule is incorrect.

Is the above a valid NAT rule? Is there a better way to achieve the desired behavior from the linux machine? The embedded code base should not be directly changed for the purpose of testing.

2
  • 1
    There is significant differences between TCP and UDP packets, which one, are you trying to forward to the sender?
    – Ramhound
    Commented Aug 24, 2021 at 0:34
  • We are using both. Although, if we could get just tcp to return, that would be fine for now.
    – schnoop
    Commented Aug 24, 2021 at 16:34

0

You must log in to answer this question.

Browse other questions tagged .