Linux Networking Commands part-4

  • Sure! Here’s a comprehensive list of Linux networking commands, particularly useful for Kali Linux:

  • ### Basic Networking Commands
  • 1. **`ifconfig`**: Configure and display network interfaces.
  •    - `ifconfig -a`: Display all interfaces, even if down.
  •    - `ifconfig eth0 up/down`: Bring an interface up or down.

  • 2. **`ip`**: More modern and powerful command to configure network interfaces.
  •    - `ip addr`: Show IP addresses.
  •    - `ip link set eth0 up/down`: Bring an interface up or down.
  •    - `ip route`: Show routing table.

  • 3. **`ping`**: Check the network connection to a host.
  •    - `ping google.com`: Ping Google to check internet connectivity.

  • 4. **`traceroute`**: Trace the route packets take to a destination.
  •    - `traceroute google.com`

  • 5. **`netstat`**: Network statistics, showing connections, routing tables, interface statistics.
  •    - `netstat -tuln`: List listening ports.

  • 6. **`ss`**: Similar to `netstat`, but more modern.
  •    - `ss -tuln`: List listening ports.

  • 7. **`dig`**: DNS lookup.
  •    - `dig google.com`: Get DNS information for google.com.

  • 8. **`nslookup`**: Another DNS lookup tool.
  •    - `nslookup google.com`

  • 9. **`route`**: Show/manipulate the IP routing table.
  •    - `route -n`: Show routing table.

  • 10. **`hostname`**: Show or set the system's hostname.
  •     - `hostname`: Display the current hostname.
  •     - `hostname newname`: Set a new hostname.

  • ### Network Configuration
  • 11. **`nmcli`**: Command-line client for NetworkManager.
  •     - `nmcli d`: Show devices.
  •     - `nmcli c`: Show connections.

  • 12. **`nmtui`**: Text user interface for NetworkManager.

  • 13. **`systemctl`**: Control the systemd system and service manager.
  •     - `systemctl restart network`: Restart the network service.

  • ### Network Troubleshooting
  • 14. **`tcpdump`**: Capture network packets.
  •     - `tcpdump -i eth0`: Capture packets on interface eth0.

  • 15. **`wireshark`**: Network protocol analyzer.
  •     - `wireshark`: Start Wireshark GUI.

  • 16. **`ethtool`**: Display and change Ethernet device settings.
  •     - `ethtool eth0`: Show settings for eth0.

  • 17. **`mtr`**: Network diagnostic tool combining ping and traceroute.
  •     - `mtr google.com`

  • 18. **`iftop`**: Display bandwidth usage on an interface.
  •     - `iftop -i eth0`

  • 19. **`nmap`**: Network scanner.
  •     - `nmap -sP 192.168.1.0/24`: Ping scan a subnet.
  •     - `nmap -sV -p 1-65535 target`: Scan all ports and attempt version detection.

  • ### File Transfer
  • 20. **`scp`**: Secure copy (remote file copy program).
  •     - `scp file.txt user@remote:/path/to/destination`

  • 21. **`rsync`**: Remote file and directory synchronization.
  •     - `rsync -avz /source/dir user@remote:/dest/dir`

  • 22. **`ftp`**: File Transfer Protocol client.
  •     - `ftp ftp.example.com`

  • 23. **`sftp`**: Secure File Transfer Protocol.
  •     - `sftp user@remote`

  • ### Network Services
  • 24. **`service`**: Control system services.
  •     - `service apache2 start/stop/restart`: Manage Apache service.

  • 25. **`systemctl`**: Control systemd system and services.
  •     - `systemctl start/stop/restart sshd`

  • 26. **`iptables`**: IPv4 packet filter rules.
  •     - `iptables -L`: List all rules.

  • 27. **`firewalld`**: Manage firewall with zones.
  •     - `firewall-cmd --list-all`: List all settings for the default zone.

  • ### VPN and Tunneling
  • 28. **`openvpn`**: OpenVPN client.
  •     - `openvpn --config client.ovpn`

  • 29. **`ssh`**: Secure Shell for remote login.
  •     - `ssh user@remote`

  • 30. **`sshuttle`**: Transparent proxy server.
  •     - `sshuttle -r user@remote 0/0`

  • ### Other Useful Commands
  • 31. **`curl`**: Transfer data from or to a server.
  •     - `curl http://example.com`

  • 32. **`wget`**: Non-interactive network downloader.
  •     - `wget http://example.com/file.zip`

  • 33. **`netcat` (or `nc`)**: Networking utility for reading from and writing to network connections.
  •     - `nc -l -p 12345`: Listen on port 12345.
  •     - `nc remote 12345`: Connect to a remote host on port 12345.

  • 34. **`ipcalc`**: Network address calculator.
  •     - `ipcalc 192.168.1.1/24`

  • 35. **`arp`**: Display and modify the ARP table.
  •     - `arp -a`: Display all ARP entries.

  • ### Wireless Networking
  • 36. **`iwconfig`**: Configure wireless network interfaces.
  •     - `iwconfig wlan0 essid "network_name"`: Connect to a wireless network.

  • 37. **`airmon-ng`**: Enable monitor mode on wireless interfaces.
  •     - `airmon-ng start wlan0`

  • 38. **`airodump-ng`**: Capture raw 802.11 frames.
  •     - `airodump-ng wlan0`

  • 39. **`aireplay-ng`**: Inject packets into a wireless network.
  •     - `aireplay-ng -1 0 -a <AP MAC> -h <Your MAC> wlan0`

  • 40. **`reaver`**: Brute force attack against WiFi Protected Setup.
  •     - `reaver -i wlan0 -b <AP MAC> -vv`

  • This is a non-exhaustive list, but it covers many of the essential networking commands used in Kali Linux. Each command can often be used with additional options and parameters, which you can explore further using the `man` (manual) command, e.g., `man ifconfig` or `man ip`.
  • Comments

    Popular posts from this blog

    Linux Commands part - 2