Listen given port

Good morning!

I would like to test a particular port in Solaris, to see if the firewall rules are ok.
Should I install an application, but as yet I have not, have to force solaris to keep an open door, and put any application listening to port 1099, and will test a terminal connectivity via Telnet or Ping.
How do I put the port 1099 open and simulate an application that is listening on that port?

You can adjust /etc/services and /etc/inetd.conf to also offer telnet on the port. Then you can open telnet from a client to that port are see if it open.

If you add a line to /etc/services such as:-

mytelnet 1099/tcp

and add a line to /etc/inetd.conf such as:-

mytelnet  stream  tcp6    nowait  root    /usr/sbin/telnetd      telnetd -a

... and then signal inetd to re-read it's config, that should be enough. Check you man page for inetd or inetd.conf. It will probably suggest you send a kill -2, kill -HUP or something similar to the inetd process. Check you man page before issuing either of these in case they cause inetd to terminate and drop all network connections/services leaving just the console to get back in.

Then, from an appropriate client (suitable source address to test your firewall) issue:-

telnet put.ip.address.here  1099

You should get an instant response. If you get a login prompt, then on the server, you can run:-

netstat -na|grep 1099

... and see what is connected.

I hope that this helps.

Robin
Liverpool/Blackburn
UK

1 Like

You can also use netcat as user: netcat -v -l -p 1099 . Then attempt telnet from outside firewall.

1 Like

It depends if your OS has that command of course. It seems to be a general Linux command rather than the commercial Solaris, HPUX or AIX for simple searching.

That's a shame, because that would save me some effort too. Our network chaps have it locked down pretty tight (and quite right too) but when you get an agreement to open something, they insist on an immediate test which makes life a bit hard. If there is something so simple as netcat on other OSs, then I'd like to know.

Robin

That's it! It worked perfectly!

Thank you!

You are welcome, I'm sure. Which solution did you use?

I'd like to know if there is and equivilent simple tool such as netcat for Solaris, HPUX & AIX. It would save me a lot of messing about.

You can register your thanks to the best solution by clicking the appropriate Thanks button. That will also help us see who did the business.

I have just put thanks to neutronscott for the pointer to a nice tool.

Robin
Liverpool/Blackburn