Networking tools commonly used in Linux for various tasks, from firewall management to network diagnostics and monitoring:
- Part of the
iproute2
package, used to manage network interfaces, routing, and devices.
- Examples:
- Check IP configuration:
ip addr show
- Set IP address:
ip addr add 192.168.1.100/24 dev eth0
- View routing table:
ip route show
- Used for configuring network interfaces, part of the
net-tools
package. Often replaced by ip
.
- Example:
- Check interface status:
ifconfig
- netstat: Used to display network connections, routing tables, and interface statistics. It’s part of the legacy
net-tools
package.
- ss: Modern alternative to
netstat
providing similar functionality but faster.
- Example:
- Display all connections:
ss -tuln
- Show listening ports:
ss -lnt
- traceroute: Displays the route packets take to reach a host.
- Example:
traceroute google.com
- mtr: Combines
ping
and traceroute
, providing real-time network path analysis and statistics.
- Used to test the reachability of a host and measure the round-trip time for messages sent.
- Example:
ping 8.8.8.8
- dig: Provides detailed DNS lookup information.
- nslookup: Simple tool to query DNS servers for domain information.
- Example:
nslookup google.com
- Command-line packet analyzer used to capture and analyze traffic on a network.
- Example:
tcpdump -i eth0
- Save captured packets:
tcpdump -i eth0 -w capture.pcap
- Network discovery and security auditing tool to scan IP addresses, open ports, and services.
- Example:
nmap -sP 192.168.1.0/24
(Ping scan a network)
- Scan for open ports:
nmap -sT 192.168.1.1
- Used to measure network bandwidth between two hosts.
- Example:
- Start server:
iperf -s
- Run client test:
iperf -c <server_ip>
- Wireshark: GUI-based packet analyzer for deep network traffic analysis.
- tshark: The command-line version of Wireshark.
- Example:
tshark -i eth0
(Capture packets from eth0
)
- Used for querying and controlling network driver and hardware settings.
- Example:
ethtool eth0
(View settings for eth0
)
- Swiss-army knife for networking. Can create raw network connections, listen on ports, send/receive data.
- Example:
- Create a simple chat server:
nc -l -p 1234
- Connect to the server:
nc <server_ip> 1234
¶ curl/wget (HTTP Requests and File Downloads)
- curl: Transfers data using various network protocols like HTTP, FTP, etc.
- Example:
curl http://example.com
- wget: A file retrieval tool for downloading files from the web.
- Example:
wget http://example.com/file.zip
- Used to view and manipulate the system’s ARP cache.
- Example:
- View ARP cache:
arp -a
- Set a static ARP entry:
arp -s 192.168.1.100 00:11:22:33:44:55
- Used to display and manipulate the IP routing table.
- Example:
route -n
(Display the routing table)
¶ Bmon (Bandwidth Monitor)
- A real-time bandwidth monitoring tool for network interfaces.
- Example:
bmon
(Run the tool to display network traffic statistics)
Identify traffic
Do you need help or support? Feel free to contact us!