'How to test that my router is forwarding in-bound UDP packets?

After UDP port forwarding has been configured on my home router, either through UPnP or by logging into the router and setting it up manually, how can I test that it is working correctly without access to a private computer outside of my LAN?

For example, I can monitor UDP port 8182 on my laptop via:

sudo tcpdump -i eth0 udp port 8281 -vv -X

If I run the following on a computer on a different LAN:

echo test_string |netcat -u MY_PUBLIC_IP 8281

then tcpdump on my laptop displays (IPs have been changed):

17:24:44.348438 IP (tos 0x0, ttl 52, id 48643, offset 0, flags [DF], proto UDP (17), length 40)
    1.2.3.4.59155 > 86.106.121.218.8281: [udp sum ok] UDP, length 12
    0x0000:  4500 0028 be03 4000 3411 3fbf 566a 79da  E..([email protected].?.Vjy.
    0x0010:  2d37 4b87 e713 2059 0014 231e 7465 7374  -7K....Y..#.test
    0x0020:  5f73 7472 696e 670a 0000                 _string...

I would like to build this functionality into an app that does not rely on anything that that requires an account or email address.

Are there any protocols, public services, or public Web APIs which would allow my app to solicit in-bound UDP packets to a specified port?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source