Quick Linux diagnostic commands (System Resource & Network)

Last Updated on

System Resources

CPU:  uptime, top
RAM:  free, top
Disk: iostat, df -h, ds -S /home | sort -rn head -n 10

Network

NIC info:                   ethtool eth0
Interface info:             ifconfig eth0
routing info:               route -n
Internet Connection:        ping bing.com -c 5
DNS check 1:                dig bing.com
DNS check 2:                host bing.com
DNS check 3:                nslookup bing.com
WAN connection 1:           ping bing.com
WAN connection 2:           traceroute bing.com
Port Open/Close:            nmap -p 80 bing.com
Check host listening on:    netstat -tunlp | grep -w 80

Config Network

DNS:                            /etc/resolv.conf
Add default route:              route add default gw 10.0.0.1
Add route 192.168.0.0/24:       route add -net 192.168.0.0 netmask 255.255.0.0 dev eth0
Remove route 192.168.0.0/23:    route del -net 192.168.0.0 netmask 255.255.0.0 dev eth0
Restart network service 1:      /etc/init.d/networking restart
Restart network service 2:      service restart networking
Restart network service 3:      systemctl restart networking
Bring up NIC 1:                 ifup eth0
Bring up NIC 2:                 ip link set eth0 up
Stop NIC 1:                     ifdown eth0
Stop NIC 2:                     ip link set eth0 down
Host name 1:                    /etc/sysconfig/network
Host name 2:                    /etc/hosts

Leave a Reply

Your email address will not be published. Required fields are marked *