Linux Network Tools

This page provides a guide on using common network tools like Netcat, Telnet, DNS utilities, Curl, Ping, and Git in Kubernetes support pods for troubleshooting and support tasks, with real-world command examples. These tools enable various network diagnostics, remote access, DNS queries, HTTP requests, and version control directly from the command line.

These support pods install common network tools. Here are some real-world use cases for each tool.

Netcat (nc)

  • Port Scanning: Identify open ports on a remote system.
    nc -zv 192.168.1.1 1-1000
    
  • Simple Client-Server Communication: Test network connectivity by simulating client-server interactions.
    nc -l -p 12345 # On the server side
    nc 192.168.1.1 12345 # On the client side
    
  • File Transfer: Transfer files between systems.
    nc -l -p 12345 > received_file.txt # On the receiving side
    nc 192.168.1.1 12345 < file_to_send.txt # On the sending side
    
  • Debugging: Monitor and debug network connections.
    nc -v -l -p 12345
    

Telnet

  • Remote System Access: Connect to remote systems for administration and troubleshooting.
    telnet remote.server.com 23
    
  • Network Diagnostics: Test network services and connectivity.
    telnet 192.168.1.1 80
    
  • Legacy System Management: Manage older systems that do not support more secure protocols like SSH.
    telnet legacy.system.com
    

DNS Utilities (dnsutils)

  • DNS Query: Query DNS servers for domain name resolution.
    nslookup example.com
    
  • DNS Record Management: Create, update, and delete DNS records.
    dig example.com MX
    
  • DNS Debugging: Diagnose DNS-related issues.
    dig +trace example.com
    

Curl

  • HTTP Requests: Make HTTP requests to web servers for testing APIs and web services.
    curl -X GET https://api.example.com/data
    
  • File Transfer: Download or upload files to/from remote servers.
    curl -O https://example.com/file.zip
    curl -T upload_file.zip ftp://ftp.example.com --user username:password
    
  • Command-line Web Browser: Browse the web directly from the command line.
    curl https://example.com
    

Ping

  • Network Connectivity Test: Check if a host is reachable on the network.
    ping google.com
    
  • Latency Measurement: Measure round-trip time for packets to and from a host.
    ping -c 10 google.com
    
  • Troubleshooting: Diagnose network issues and verify connectivity.
    ping 192.168.1.1
    

Git

  • Version Control: Track changes in source code during software development.
    git init
    git add .
    git commit -m "Initial commit"
    
  • Collaboration: Collaborate with other developers by sharing code repositories.
    git clone https://github.com/user/repo.git
    git push origin main
    
  • Project Management: Manage project versions and branches efficiently.
    git branch feature-branch
    git checkout feature-branch
    git merge main
    

Last modified February 19, 2025: Update azure-point-to-site-vpn.md (a9c807a)