July 19, 2022

RHEL 9.0 Troubleshooting Networking

Troubleshoot Connectivity Between Hosts

$ man ping
...
       -c count
           Stop after sending count ECHO_REQUEST packets. With deadline
           option, ping waits for count ECHO_REPLY packets, until the timeout
           expires.
...

$ ping -c 3 8.8.8.8

Troubleshoot Router Issues

$ ip route show
default via 192.168.122.1 dev enp1s0 proto dhcp metric 100 
192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.58 metric 100 

Use the ip command -6 option to show the IPv6 routing table. 
$ ip -6 route

$ tracepath access.redhat.com
 1?: [LOCALHOST]                      pmtu 1500
 1:  fedora                                                0.451ms 
 1:  fedora                                                0.316ms 
 2:  home                                                  6.161ms 
...

Troubleshoot Port and Service Issues

Well-known names for standard ports are listed in the /etc/services file. The ss command is used to display socket statistics. The ss command replaces the older netstat tool, from the net-tools package, which might be more familiar to some system administrators but is not always installed.

$ ss -ta|--tcp --all

-n, --numeric       don't resolve service names
-t, --tcp           display only TCP sockets
-u, --udp           display only UDP sockets
-a, --all           display all sockets
-l, --listening     display listening sockets
-p, --processes     show process using socket
-A, --query=QUERY, --socket=QUERY
   QUERY := {all|inet|tcp|mptcp|udp|raw|unix|unix_dgram|unix_stream|unix_seqpacket|packet|netlink|vsock_stream|vsock_dgram|tipc}[,QUERY]

$ ss -a -A inet
Netid      State       Recv-Q      Send-Q                   Local Address:Port                  Peer Address:Port        Process      
icmp6      UNCONN      0           0                                    *:ipv6-icmp                        *:*                        
udp        ESTAB       0           0                192.168.122.58%enp1s0:bootpc               192.168.122.1:bootps                   
udp        UNCONN      0           0                            127.0.0.1:323                        0.0.0.0:*                        
udp        UNCONN      0           0                                [::1]:323                           [::]:*                        
tcp        LISTEN      0           128                            0.0.0.0:ssh                        0.0.0.0:*                        
tcp        ESTAB       0           0                       192.168.122.58:ssh                  192.168.122.1:38358                    
tcp        LISTEN      0           128                               [::]:ssh                           [::]:*    

No comments: