Netcat message passing in the same LAN doesn't seem to work

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am trying to send one message from one computer in my home LAN to another in the same LAN using netcat.
This is the code I am running in bash:
In PC1



nc -l -p 31337


In PC2 (Private IP Address 192.168.1.10)



nc 192.168.1.10 31337


The problem is that when I send a message in one terminal, nothing seems to appear on the other PC and vice versa.
Doing the same thing on the same PC, but with two terminal windows open, everything works fine. However there is no point in sending one message from one terminal to another in the same computer. What I want is to send from one PC in my home LAN to another.



PS I am working on Ubuntu 16.04.4 on both PCs







share|improve this question

















  • 1




    are you running a firewall on either system? What do you get when you run nc -vvv ...?
    – Patrick
    Apr 28 at 4:25














up vote
0
down vote

favorite












I am trying to send one message from one computer in my home LAN to another in the same LAN using netcat.
This is the code I am running in bash:
In PC1



nc -l -p 31337


In PC2 (Private IP Address 192.168.1.10)



nc 192.168.1.10 31337


The problem is that when I send a message in one terminal, nothing seems to appear on the other PC and vice versa.
Doing the same thing on the same PC, but with two terminal windows open, everything works fine. However there is no point in sending one message from one terminal to another in the same computer. What I want is to send from one PC in my home LAN to another.



PS I am working on Ubuntu 16.04.4 on both PCs







share|improve this question

















  • 1




    are you running a firewall on either system? What do you get when you run nc -vvv ...?
    – Patrick
    Apr 28 at 4:25












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to send one message from one computer in my home LAN to another in the same LAN using netcat.
This is the code I am running in bash:
In PC1



nc -l -p 31337


In PC2 (Private IP Address 192.168.1.10)



nc 192.168.1.10 31337


The problem is that when I send a message in one terminal, nothing seems to appear on the other PC and vice versa.
Doing the same thing on the same PC, but with two terminal windows open, everything works fine. However there is no point in sending one message from one terminal to another in the same computer. What I want is to send from one PC in my home LAN to another.



PS I am working on Ubuntu 16.04.4 on both PCs







share|improve this question













I am trying to send one message from one computer in my home LAN to another in the same LAN using netcat.
This is the code I am running in bash:
In PC1



nc -l -p 31337


In PC2 (Private IP Address 192.168.1.10)



nc 192.168.1.10 31337


The problem is that when I send a message in one terminal, nothing seems to appear on the other PC and vice versa.
Doing the same thing on the same PC, but with two terminal windows open, everything works fine. However there is no point in sending one message from one terminal to another in the same computer. What I want is to send from one PC in my home LAN to another.



PS I am working on Ubuntu 16.04.4 on both PCs









share|improve this question












share|improve this question




share|improve this question








edited Apr 27 at 23:47









Jeff Schaller

31.1k846105




31.1k846105









asked Apr 27 at 23:39









Jack D.

32




32







  • 1




    are you running a firewall on either system? What do you get when you run nc -vvv ...?
    – Patrick
    Apr 28 at 4:25












  • 1




    are you running a firewall on either system? What do you get when you run nc -vvv ...?
    – Patrick
    Apr 28 at 4:25







1




1




are you running a firewall on either system? What do you get when you run nc -vvv ...?
– Patrick
Apr 28 at 4:25




are you running a firewall on either system? What do you get when you run nc -vvv ...?
– Patrick
Apr 28 at 4:25










2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










The way you test this is:



1) Open a second window both on PC1 and PC2, start tcpdump or wireshark on the LAN interface, e.g. tcpdump -ni eth0.



2) Do a ping from PC1 to PC2, and from PC2 to PC1. See if you get ping replies, verify you can see the packets in the dump.



If you can't see the ping replies, something in your network setup is broken. Find it and fix it.



3) Now use nc, again observe the packets. Depending on the outcome, you now have an idea where the problem is.






share|improve this answer





















  • Ok these are the results of what I changed.
    – Jack D.
    Apr 28 at 8:01










  • First of all I connected both PCs into another LAN network. This time netcat worked but only if the listener was the 2nd PC and the sender the 1st PC (and indeed I could ping PC2 from PC1 but not the opossite). Then I opened wireshark on PC1 and tryed pinging it from PC2, with the results being "Destination Host Unreachable" and on wireshark I see a lot of ARP requests "Who has 192.168.1.10(PC1 IP)?Tell 192.168.1.4 (PC2 IP)"
    – Jack D.
    Apr 28 at 8:12










  • Please edit question with new information; don't put it in the comments (comments may be deleted by the system at some stage). This looks like something in your LAN configuration is screwed up (firewall on the router?), so you must investigate your routers/your setup.
    – dirkt
    Apr 28 at 10:09

















up vote
0
down vote













The problem was that my Windows Firewall was blocking inbound requests to port 31337 (the code in the PC was running on Linux Subsystem for Windows).
So you have to go to Control Panel -> System and Security -> Windows Defender Firewall and choose Advanced Settings. There make a new inbound rule to allow requests to port 31337.






share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f440516%2fnetcat-message-passing-in-the-same-lan-doesnt-seem-to-work%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    The way you test this is:



    1) Open a second window both on PC1 and PC2, start tcpdump or wireshark on the LAN interface, e.g. tcpdump -ni eth0.



    2) Do a ping from PC1 to PC2, and from PC2 to PC1. See if you get ping replies, verify you can see the packets in the dump.



    If you can't see the ping replies, something in your network setup is broken. Find it and fix it.



    3) Now use nc, again observe the packets. Depending on the outcome, you now have an idea where the problem is.






    share|improve this answer





















    • Ok these are the results of what I changed.
      – Jack D.
      Apr 28 at 8:01










    • First of all I connected both PCs into another LAN network. This time netcat worked but only if the listener was the 2nd PC and the sender the 1st PC (and indeed I could ping PC2 from PC1 but not the opossite). Then I opened wireshark on PC1 and tryed pinging it from PC2, with the results being "Destination Host Unreachable" and on wireshark I see a lot of ARP requests "Who has 192.168.1.10(PC1 IP)?Tell 192.168.1.4 (PC2 IP)"
      – Jack D.
      Apr 28 at 8:12










    • Please edit question with new information; don't put it in the comments (comments may be deleted by the system at some stage). This looks like something in your LAN configuration is screwed up (firewall on the router?), so you must investigate your routers/your setup.
      – dirkt
      Apr 28 at 10:09














    up vote
    0
    down vote



    accepted










    The way you test this is:



    1) Open a second window both on PC1 and PC2, start tcpdump or wireshark on the LAN interface, e.g. tcpdump -ni eth0.



    2) Do a ping from PC1 to PC2, and from PC2 to PC1. See if you get ping replies, verify you can see the packets in the dump.



    If you can't see the ping replies, something in your network setup is broken. Find it and fix it.



    3) Now use nc, again observe the packets. Depending on the outcome, you now have an idea where the problem is.






    share|improve this answer





















    • Ok these are the results of what I changed.
      – Jack D.
      Apr 28 at 8:01










    • First of all I connected both PCs into another LAN network. This time netcat worked but only if the listener was the 2nd PC and the sender the 1st PC (and indeed I could ping PC2 from PC1 but not the opossite). Then I opened wireshark on PC1 and tryed pinging it from PC2, with the results being "Destination Host Unreachable" and on wireshark I see a lot of ARP requests "Who has 192.168.1.10(PC1 IP)?Tell 192.168.1.4 (PC2 IP)"
      – Jack D.
      Apr 28 at 8:12










    • Please edit question with new information; don't put it in the comments (comments may be deleted by the system at some stage). This looks like something in your LAN configuration is screwed up (firewall on the router?), so you must investigate your routers/your setup.
      – dirkt
      Apr 28 at 10:09












    up vote
    0
    down vote



    accepted







    up vote
    0
    down vote



    accepted






    The way you test this is:



    1) Open a second window both on PC1 and PC2, start tcpdump or wireshark on the LAN interface, e.g. tcpdump -ni eth0.



    2) Do a ping from PC1 to PC2, and from PC2 to PC1. See if you get ping replies, verify you can see the packets in the dump.



    If you can't see the ping replies, something in your network setup is broken. Find it and fix it.



    3) Now use nc, again observe the packets. Depending on the outcome, you now have an idea where the problem is.






    share|improve this answer













    The way you test this is:



    1) Open a second window both on PC1 and PC2, start tcpdump or wireshark on the LAN interface, e.g. tcpdump -ni eth0.



    2) Do a ping from PC1 to PC2, and from PC2 to PC1. See if you get ping replies, verify you can see the packets in the dump.



    If you can't see the ping replies, something in your network setup is broken. Find it and fix it.



    3) Now use nc, again observe the packets. Depending on the outcome, you now have an idea where the problem is.







    share|improve this answer













    share|improve this answer



    share|improve this answer











    answered Apr 28 at 6:23









    dirkt

    14k2930




    14k2930











    • Ok these are the results of what I changed.
      – Jack D.
      Apr 28 at 8:01










    • First of all I connected both PCs into another LAN network. This time netcat worked but only if the listener was the 2nd PC and the sender the 1st PC (and indeed I could ping PC2 from PC1 but not the opossite). Then I opened wireshark on PC1 and tryed pinging it from PC2, with the results being "Destination Host Unreachable" and on wireshark I see a lot of ARP requests "Who has 192.168.1.10(PC1 IP)?Tell 192.168.1.4 (PC2 IP)"
      – Jack D.
      Apr 28 at 8:12










    • Please edit question with new information; don't put it in the comments (comments may be deleted by the system at some stage). This looks like something in your LAN configuration is screwed up (firewall on the router?), so you must investigate your routers/your setup.
      – dirkt
      Apr 28 at 10:09
















    • Ok these are the results of what I changed.
      – Jack D.
      Apr 28 at 8:01










    • First of all I connected both PCs into another LAN network. This time netcat worked but only if the listener was the 2nd PC and the sender the 1st PC (and indeed I could ping PC2 from PC1 but not the opossite). Then I opened wireshark on PC1 and tryed pinging it from PC2, with the results being "Destination Host Unreachable" and on wireshark I see a lot of ARP requests "Who has 192.168.1.10(PC1 IP)?Tell 192.168.1.4 (PC2 IP)"
      – Jack D.
      Apr 28 at 8:12










    • Please edit question with new information; don't put it in the comments (comments may be deleted by the system at some stage). This looks like something in your LAN configuration is screwed up (firewall on the router?), so you must investigate your routers/your setup.
      – dirkt
      Apr 28 at 10:09















    Ok these are the results of what I changed.
    – Jack D.
    Apr 28 at 8:01




    Ok these are the results of what I changed.
    – Jack D.
    Apr 28 at 8:01












    First of all I connected both PCs into another LAN network. This time netcat worked but only if the listener was the 2nd PC and the sender the 1st PC (and indeed I could ping PC2 from PC1 but not the opossite). Then I opened wireshark on PC1 and tryed pinging it from PC2, with the results being "Destination Host Unreachable" and on wireshark I see a lot of ARP requests "Who has 192.168.1.10(PC1 IP)?Tell 192.168.1.4 (PC2 IP)"
    – Jack D.
    Apr 28 at 8:12




    First of all I connected both PCs into another LAN network. This time netcat worked but only if the listener was the 2nd PC and the sender the 1st PC (and indeed I could ping PC2 from PC1 but not the opossite). Then I opened wireshark on PC1 and tryed pinging it from PC2, with the results being "Destination Host Unreachable" and on wireshark I see a lot of ARP requests "Who has 192.168.1.10(PC1 IP)?Tell 192.168.1.4 (PC2 IP)"
    – Jack D.
    Apr 28 at 8:12












    Please edit question with new information; don't put it in the comments (comments may be deleted by the system at some stage). This looks like something in your LAN configuration is screwed up (firewall on the router?), so you must investigate your routers/your setup.
    – dirkt
    Apr 28 at 10:09




    Please edit question with new information; don't put it in the comments (comments may be deleted by the system at some stage). This looks like something in your LAN configuration is screwed up (firewall on the router?), so you must investigate your routers/your setup.
    – dirkt
    Apr 28 at 10:09












    up vote
    0
    down vote













    The problem was that my Windows Firewall was blocking inbound requests to port 31337 (the code in the PC was running on Linux Subsystem for Windows).
    So you have to go to Control Panel -> System and Security -> Windows Defender Firewall and choose Advanced Settings. There make a new inbound rule to allow requests to port 31337.






    share|improve this answer

























      up vote
      0
      down vote













      The problem was that my Windows Firewall was blocking inbound requests to port 31337 (the code in the PC was running on Linux Subsystem for Windows).
      So you have to go to Control Panel -> System and Security -> Windows Defender Firewall and choose Advanced Settings. There make a new inbound rule to allow requests to port 31337.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        The problem was that my Windows Firewall was blocking inbound requests to port 31337 (the code in the PC was running on Linux Subsystem for Windows).
        So you have to go to Control Panel -> System and Security -> Windows Defender Firewall and choose Advanced Settings. There make a new inbound rule to allow requests to port 31337.






        share|improve this answer













        The problem was that my Windows Firewall was blocking inbound requests to port 31337 (the code in the PC was running on Linux Subsystem for Windows).
        So you have to go to Control Panel -> System and Security -> Windows Defender Firewall and choose Advanced Settings. There make a new inbound rule to allow requests to port 31337.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Apr 28 at 16:05









        Jack D.

        32




        32






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f440516%2fnetcat-message-passing-in-the-same-lan-doesnt-seem-to-work%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?