netcat working on localhost but not from remote host


I have two machines (Machine1 & Machine2) on the same subnet. Machine1 has a tool installed that returns some data. for example if I run the following command, it returns some data.

printf "get:info\nend\n" | nc localhost 1234

However if do the same on Machine2, of course changing localhost to machine1, nothing happens. Any Idea what can be the problem?

printf "get:info\nend\n" | nc machine1 1234


After investigating alot I finally managed to find the reason why I was not able to communicate to the other machine on the specific port.

Iptables setting in my machine1 was not allowing machine1 to listen. I turned off of the iptables and everthing worked fine.

But its not a good idea to turn off the iptables. So for the next step I allowed port 1234 for machine1.

sudo iptables -A INPUT -p tcp --dport 1234 -j ACCEPT

You can find more information about iptables on the link below:



  • Ajax upload not executing the PHP script [duplicate]
  • Is array_key_exists('submit_input_name',$_POST) better than ($_POST[“MM_insert”] == “submi
  • Serving static files with nginx on multiple machines and hard drives
  • How to implement ISerializable in F#
  • How to handle screen rotation/orientation in Xamarin Forms?
  • ARM MOV and MVN operand
  • htaccess will not rewrite subdomains
  • Mod rewrite redirection to another domain if file not exist
  • Nginx rewrite equivalent to Apache RewriteRule that converts URL params into QueryString key/value p
  • Losing my session variables
  • CORS with socket.io
  • IE6 changes DOCTYPE to a bad one
  • Primefaces lazy datascroller calling load twice
  • Better Indy for Dephi 2007
  • mave 3.2 not able to access local nexus instance return 502 code
  • Cannot save model when using ember render helper
  • How to access meteor package name inside package?
  • VBA Excel, loop through variables
  • Rest Services conventions
  • Clear fused location provider's location for testing
  • SonarQube: Cannot deactivate rule with missing quality profile
  • Trying to get the char code of ENTER key
  • Tomcat memory Leak
  • Using Sax parsing to edit and write XML in VB6
  • Debug.DrawLine not showing in the GameView
  • htaccess add www if not subdomain, if subdomain remove www
  • Yii2: Config params vs. const/define
  • Cannot resolve symbol 'MyApi'
  • Read text file and split every line in MSBuild
  • C# - Serializing and deserializing static member
  • Java applet as stand-alone Windows application?
  • Join two tables and save into third-sql
  • How to model a transition system with SPIN
  • ORA-29908: missing primary invocation for ancillary operator
  • Error creating VM instance in Google Compute Engine
  • How can I remove ASP.NET Designer.cs files?
  • python draw pie shapes with colour filled
  • Is there any way to bind data to data.frame by some index?
  • How can i traverse a binary tree from right to left in java?
  • Converting MP3 duration time