Following action plan can be implemented to debug the connection issues from one host to other host over specific port.
1) On the Destination VM, run netcat command as follows to start listening on port which has issues, for example lets assume port 2430. You can change this port to whatever port you choose.
nc -lv 2430
2) Now open Duplicate session to Destination VM and run tcpdump command as follows. Leave the window open with tcpdump running on port 2430. Change the port number as needed if you are not using 2430. Also change the interface name bondX to interface name corresponding to the Destination VM. below command will save tcpdump pcap capture file under /tmp directory with the hostname of the machine.
tcpdump -i bondX -nn port 2430 -w /tmp/`hostname -s`.pcap
3) Now open Session to Source VM and run below tcpdump command. Leave the window open.
tcpdump -i bondX -nn port 2430 -w /tmp/`hostname -s`.pcap
Change bondX in above command to bond number of Source VM from where communication is happening. Change port 2430 as needed if you are using different port. Above command will save tcpdump pcap capture file under /tmp directory with the hostname of the machine.
4) Now open duplicate session to Source VM and run below command to connect to Destination VM. Change the IP and port number as needed.
nc -w 2 <Destination VM IP> 2430
w flag in above command means that connection will timeout after waiting 2 seconds.
In a working scenario you should be seeing TCP Sent and acknowledgement packages between source and destination as follows from tcpdump captures
reading from file elorl02cn02.pcap, link-type EN10MB (Ethernet)
18:05:22.095588 IP host1.50899 > host2.venus: Flags [S], seq 1755432405, win 42340, options [mss 1460,sackOK,TS val 3911386704 ecr 0,nop,wscale 12], length 0
18:05:22.095606 IP host2.venus > host1.50899: Flags [R.], seq 0, ack 1755432406, win 0, length 0
18:05:22.095588 IP host1.50899 > host2.venus: Flags [S], seq 1755432405, win 42340, options [mss 1460,sackOK,TS val 3911386704 ecr 0,nop,wscale 12], length 0
18:05:22.095606 IP host2.venus > host1.50899: Flags [R.], seq 0, ack 1755432406, win 0, length 0
Products to which Article Applies
All Linux Operating Systems
Search Keywords: tcpdump tcp dump network capture pcap pcaps captures debug debugging troubleshoot troubleshooting issue issues networking packet packets tcp tcpip ip communication communications communicating trace traces netcat telnet connection connect connecting problem problems how to listen listening
Article Author: Tarun Boyella
No comments:
Post a Comment