Testing UDP ports work in container, but not RedHat Linux

docker ps | grep graylog
548adc37e1c2 registry:5000/hac-graylog:2.4.6 “/docker-entrypoin…” About an hour ago Up About an hour (healthy)>9000/tcp,>12201/tcp graylog

In the RedHat Linux host, the test script was not received.
echo -n ‘{ “version”: “1.1”, “host”: “example.org”, “short_message”: “A short message”, “level”: 5, “_some_info”: “foo” }’ > /dev/udp/

However, in the graylog container, it works with the following test scripts
echo -n ‘{ “version”: “1.1”, “host”: “example.org”, “short_message”: “A short message”, “level”: 5, “_some_info”: “foo” }’ > /dev/udp/

Any hints why it does not work in the Redhat Linux host. Many thanks.

I’m not yet familiar with Docker, containers and how the networking works. Do I understand things correctly if I read your config as: the Docker host has port 10501 listening on, which is forwarded to port 12201 inside the Docker container?

Should you not be pointing them towards the external IP of the Docker host?

Check on the Docker host with netstat -an | grep ^tcp | grep 10501 to see on which IPs the listener is accessible. If it’s, then you should technically speaking be able to also ping it through on the Docker host. But not from any host in the network; that will always require the external IP.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.