4

I've been trying to modernise my way with Linux by, for one thing, ditching netstat for ss. I looked up my favourite command line flag for netstat in the ss man pages, and was very glad to find that netstat -lnp is more or less the same command as ss -lnp. Or so I thought...

# ss -lnp | grep 1812

Turns up nothing, but

# netstat -lnp | grep 1812
udp        0      0 0.0.0.0:1812            0.0.0.0:*                           11103/radiusd

does. A fact that made that particular troubleshooting unnecessarily harder.

Now I'm trying to understand how I should have used ss to verify that the daemon was listening.

Can someone please explain?

EDIT:

# ss --version
ss utility, iproute2-ss090324
# ss -aunp | grep radi
UNCONN     0      0                         *:50482                    *:*      users:(("radiusd",11103,11))
UNCONN     0      0                 127.0.0.1:18120                    *:*      users:(("radiusd",11103,9))
UNCONN     0      0                         *:1812                     *:*      users:(("radiusd",11103,6))
UNCONN     0      0                         *:1813                     *:*      users:(("radiusd",11103,7))
UNCONN     0      0                         *:1814                     *:*      users:(("radiusd",11103,10))
# ss -lnp | grep radi
#
  • Does radiusd show at all in ss? – derobert Jan 30 '15 at 11:44
2

A recent version of ss should also display UDP listeners in that way. You can limit to UDP with ss -unlp.

I have tried a recent Debian version where ss --version reports ss utility, iproute2-ss140804 and that does work.

On A Red Hat 5 system with ss utility, iproute2-ss061002 it doesn't. You do get more info there using ss -aunp although that also shows connected ports.

You can also try:

ss -apu state unconnected 'sport = :1812'
  • Odd, none of these commands work on a Raspberry Pi with ss version ss140804. However, they work perfectly on Fedora with ss version ss170501. I guess that's what happens when I use three year old software :( – Navin Dec 2 '17 at 23:45
  • That's why I wrote "A recent version ..." :-) – wurtel Dec 7 '17 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.