Basic Networking Commands

Networking commands are essential for setting up, maintaining, and troubleshooting network connections in UNIX/Linux systems. This section covers the basic commands used for these purposes.

Connection Testing and Configuration

ping: Test network connectivity. Usage: ping hostname_or_ip

ifconfig/ip: Display or configure network interfaces. Usage: ifconfig or ip addr show

traceroute: Trace the route packets take to a network host. Usage: traceroute hostname

Secure Network Communication

ssh: Securely connect to remote machines. Usage: ssh username@hostname

scp: Securely copy files between machines. Usage: scp source_file username@hostname:destination_folder

Network Monitoring and Management

netstat: Display network connections, routing tables, interface statistics, and more. Usage: netstat -an

nc (netcat): Versatile tool for reading from and writing to network connections. Usage: nc hostname port

nmap: Network exploration tool and security / port scanner. Usage: nmap -v hostname

tcpdump: Command-line packet analyzer. Usage: tcpdump -i eth0

ss: Investigates sockets. Usage: ss -tulpn

Advanced Networking Techniques

For more complex networking needs, these advanced commands can provide deeper insights and broader control over network configurations and analysis.

iptables: Control the Linux kernel's network packet filtering framework. Usage: iptables -L

firewalld: Manage firewall rules with a dynamic daemon. Usage: firewall-cmd --list-all

route: Show/manipulate the IP routing table. Usage: route -n

dig: DNS lookup utility. Usage: dig example.com

curl: Tool to transfer data from or to a server. Usage: curl http://example.com

wget: Network downloader. Usage: wget http://example.com/file.txt