Testing UDP ports work in container, but not RedHat Linux


(Michael Leung) #1

docker ps | grep graylog
548adc37e1c2 registry:5000/hac-graylog:2.4.6 “/docker-entrypoin…” About an hour ago Up About an hour (healthy) 172.16.65.71:10580->9000/tcp, 172.16.65.71:10501->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/127.0.0.1/10501

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/127.0.0.1/12201

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


(Tess) #2

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 172.16.65.71, 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 0.0.0.0, then you should technically speaking be able to also ping it through 127.0.0.1 on the Docker host. But not from any host in the network; that will always require the external IP.


(system) closed #3

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