dannagle / PacketSender

Network utility for sending / receiving TCP, UDP, SSL, HTTP
https://packetsender.com
GNU General Public License v2.0
2.31k stars 361 forks source link

Error: Could Not Connect #202

Open mgb0908 opened 3 years ago

mgb0908 commented 3 years ago

What OS?

Description of issue

I am new to networking and wanted to play around with a few tools and I came across PacketSender. I am trying to send TCP Packets from one machine to another, however, I get the error: Could not connect.

Pinging to the same IP from the terminal works. Any suggestions regarding this would be really helpful! Thanks in advance!

dannagle commented 3 years ago

You need to get all the listening ports and sending ports correct. Simply pinging is not enough.

Check out the loopback test mentioned in this ticket: #172

Once you get that test working and you understand what is happening, try the test again across different computers and IPs.

Hope that helps.

mgb0908 commented 3 years ago

Screenshot from 2020-10-29 21-35-13 I did run the loopback test and understood what you were saying, however when i try to send from linux A(wired connection) to linux B machine(wired connection) or vice versa I get the could not connect error.

However, I am able to send from either Linux A/B machine(wired connection) to my windows(WIFi) and it works, but it again fails for Windows(WiFi) to Linux A/B(wired)

As you can see I have used the right port and addresses on both Packet Sender windows

UDP IS SUCCESFUL BETWEEN ANY 2 Configurations

mgb0908 commented 3 years ago

This is the screenshot from wireshark of the machine listening on port 24000, There is a message received but I believe there should be some sort of acknowledgement for the connection to display successful Screenshot from 2020-10-29 22-10-49

dannagle commented 3 years ago

This is starting to sound like some kind of firewall problem. Do the bundled sample packets work (assuming the screenshot computers have internet access)?

Firewalls are far more likely to block TCP servers versus UDP servers. If it is firewall, the client may be allowed to send, but the server is being blocked from receiving.

embeddedsystem2013 commented 3 years ago

I have the same problem. I disabled the firewall and i cant see that the packetsender send anything on ipv6 and i used sudo tcpdump -i any port 20000 to monitor if i receive something and nothing i receive

however i use another C code to send on the same port. and the same tcpdump command is seeing it. Im testing on ubuntu

embeddedsystem2013 commented 3 years ago

and im sending and receiving on the same virtual machine using IP6 found on one of the interfaces

dannagle commented 3 years ago

Packet Sender has an explicit IPv6 mode. Click the toggle button on the bottom right. You can also explicitly bind to an address in settings.

embeddedsystem2013 commented 3 years ago

ya I already on IPv6 mode and i used it successfully with the UDP protocol. my problem is about the TCP. It doesn't send any thing. i tried to listen with TCPDUMP and i get nothing from the packet sender.

it just says, couldn't connect

dannagle commented 3 years ago

Do any of the sample TCP packets work (the ones that are included with a fresh install) ?

If you need to reimport them to test, here is a cloud import link: https://cloud.packetsender.com/dannagle/starterset

embeddedsystem2013 commented 3 years ago

I tried the sample and it isnt connecting

image

as you see both trials gives not connected. the port number seems to be strange for the sample tcp packet ? Also the first line show when I try to send the packet to my local IP ans there is no " from port displayed at all"

dannagle commented 3 years ago

Maybe a setting got corrupted.

Can you try with a fresh portable version? https://github.com/dannagle/PacketSender/releases/download/v7.0.5/PacketSenderPortable_v7.0.6.zip

embeddedsystem2013 commented 3 years ago

im running on linux ubuntu VM as I stated :) so how can I use Zip file? I also tried to install previous old version V5.7 as I remember and it has the same problem

dannagle commented 3 years ago

Sorry, I jump between multiple questions, and it can get jumbled in my mind.

OK, for a VM you will want to use "bridged networking". VMs usually select NAT by default which can cause all kinds of problems when running a server. When you configure the VM with bridge, your router will see the VM as a separate computer and allocate its own IP address.

Also, I am curious if Packet Sender default packet set works OK on your host computer.

embeddedsystem2013 commented 3 years ago

I think problem may not related to VM (I mean my original problem not the testing on the reference default sites ) because the following, and correct me please if i'm wrong 1- I used netcat and it is working perfect with ip6 on tcp on the same setup 2- my problem is between two instances in the same VM so no router is needed

I tried netcat and tried another compiled 2 different C codes and all of them working with the same setup. All working except the packet sender which just work with me as UDP only

dannagle commented 3 years ago

Packet Sender has had compatibility problem with CentOS and other Red Hat-based distros in the past, but what happened is the app would not launch at all. So this is new. That screenshot looks like CentOS 8. I've not attempted that version before. Perhaps it is a different kind of compatibility problem now.

I'll need to set up my own test, but I unfortunately do not have time to dig into it for the next couple weeks. I have seen CentOS success through compiling Packet Sender by source if you'd like to clone this repo and attempt that. You will need the Qt libraries. The yum repos should have them. If you need newer than what yum provides, the tools are also a free download from qt.io though you'll need to create a (free) account.

I'll flag this as a bug for now.

embeddedsystem2013 commented 3 years ago

This bug is on ubuntu ( as i mentioned twice here :) :) ) 18.04.5 LTS inside Virtual Machine oracle VM what is the steps that I can do for help to discover where is the problem?

dannagle commented 3 years ago

Step 1 would be to compile by source. It's possible I did something wrong when packaging it.

embeddedsystem2013 commented 3 years ago

ok this happened to 2 versions 7.0.5 and 5.7 i guess. which i was testing. so may be packaging of AppImage then because both are AppImage Extension

pauloconeglian-icrop commented 1 year ago

I know it is late but I used the WSL IP instead localhost and it worked. image