12 September 2019

Network Troubleshooting

Summary of networking tools for troubleshooting.

  1. https://developer.ibm.com/articles/au-aixnetworkproblem1/
  2. https://www.tecmint.com/linux-network-configuration-and-troubleshooting-commands/


responsive ping

$ ping testhost
PING testhost: (10.217.1.206): 56 data bytes
64 bytes from 10.217.1.206: icmp_seq=0 ttl=253 time=0 ms
64 bytes from 10.217.1.206: icmp_seq=1 ttl=253 time=0 ms
64 bytes from 10.217.1.206: icmp_seq=2 ttl=253 time=0 ms


ping unresponsive:

$ ping testhost
PING testhost.testdomain.com: (10.216.122.12): 56 data bytes

‑‑‑‑testhost.testdomain.com PING Statistics‑‑‑‑
5 packets transmitted, 0 packets received, 100% packet loss


Displaying network adapter status

$ ifconfig en1
en1: flags=7e080863,40    CHECKSUM_OFFLOAD,CHECKSUM_SUPPORT,PSEG>
        inet 10.216.163.37 netmask 0xffffff00 broadcast 10.216.163.255
         tcp_sendspace 131072 tcp_recvspace 65536

$ifconfig ‑a
en2: flags=7e080863,40
      CHECKSUM_OFFLOAD,CHECKSUM_SUPPORT,PSEG>
        inet 10.203.35.14 netmask 0xffffff80 broadcast 10.203.35.127
en1: flags=7e080863,40
    CHECKSUM_OFFLOAD,CHECKSUM_SUPPORT,PSEG>
        inet 10.216.163.37 netmask 0xffffff00 broadcast 10.216.163.




Displaying Ethernet statistics for a network adapter
   
$ entstat ‑d en2
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
ETHERNET STATISTICS (en2) :
Device Type: 10/100/1000 Base‑TX PCI‑X Adapter (14106902)
Hardware Address: 00:02:55:d3:37:be
Elapsed Time: 114 days 22 hours 48 minutes 20 seconds

Transmit Statistics:           Receive Statistics:
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑           ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
Packets: 490645639             Packets: 3225432063
Bytes: 9251643184881           Bytes: 215598601362
Interrupts: 0                  Interrupts: 3144149248



Tracing a successful route to a host   

$ traceroute testhost
trying to get source for testhost
source should be 10.216.163.37
traceroute to testhost (10.217.1.206) from 10.216.163.37 (10.216.163.37), 30 hops max
outgoing MTU = 1500
 1  10.216.163.2 (10.216.163.2)  1 ms  0 ms  0 ms
 2  10.217.189.6 (10.217.189.6)  0 ms  0 ms  0 ms
 3  testhost (10.217.1.206)  1 ms  1 ms  1 ms

traceroute -p 40015 200.14.166.72


Testing port 80 (HTTP) on a host (successful)

$ telnet testhost 80
Trying...
Connected to testhost.
Escape character is '^]'.
^]
telnet> quit
Connection closed.


$ grep testhost /etc/hosts
10.217.1.206    testhost testhost.testdomain.com aixserver
 

$ curl 10.217.1.206:22
SSH-2.0-OpenSSH_7.4
curl: (56) Recv failure: Connection reset by peer




Resolving a host name via DNS

$ nslookup testhost
Server:  testdns.testdomain.com
Address:  158.177.79.90

Name:    testhost.testdomain.com
Address:  10.217.1.206

nslookup www.devweb.cl 1.1.1.1

Dig

dig @8.8.8.8 +trace stackoverflow.com

  1. https://www.digwebinterface.com/
  2. https://mxtoolbox.com/SuperTool.aspx
  3. https://dnschecker.org/#A/corporate.bcimiami.com



Get DNS Records Using dig and host Commands

You can use the dig command to verify DNS mappings, host addresses, MX records, and all other DNS records for a better understanding of DNS topography.

The dig command was developed to replace nslookup command.

$ dig google.com


Telnet without telnet:

curl -v telnet://127.0.0.1:22

cat < /dev/tcp/127.0.0.1/22


telnet: ctrl+] is an escape sequence that puts telnet into command mode,

curls cookies

curl -c - "http://127.0.0.1:7001/sample/deals-api-aggregator"

curl -c - "http://127.0.0.1:7001/sample/presentacion-0.0.1-SNAPSHOT/"

curl -v --cookie 'JSESSIONIDMULTIPRO=123' -c - "http://127.0.0.1:7001/sample/deals-api-aggregator/"


steroids:

mtr >> ping/traceroute
curl >> wget
htop >> ps/top
ncdu >> du
parallel >> xargs/ssh
rsync >> cp/scp
ag >> find/grep
dig >> nslookup


SSL test:

https://www.ssllabs.com/ssltest/analyze.html?d=github.com&s=192.30.255.112&hideResults=on

Misc

netstat -apn (linux)

nmap

netstat -apn | grep 8001

 

how to know IP :
ipconfig

ifconfig | grep "inet " | grep -v 127.0.0.1

linux:
ifconfig eth0


lsof:

lsof -i @127.0.0.1:7001
lsof -p <pid>


netstat cheat sheet 


No comments :

My Blog List

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.