This is a simple Bash script that gathers and displays various network-related information on a Linux system.
The script provides the following network statistics:
- Default Gateway: Retrieves the default gateway IP address.
- Primary DNS Server: Retrieves the primary DNS server IP address.
- External IP Address: Retrieves the external IP address of the system using an online API.
- Network Interfaces: Lists all network interfaces and their associated IP addresses.
- Network Statistics: Displays the total bytes received/transmitted and total packets received/transmitted across all network interfaces.
- Save the script to a file, e.g.,
network_stats.sh. - Make the script executable with
chmod +x network_stats.sh. - Run the script with
./network_stats.sh.
If you have any suggestions or improvements, feel free to submit a pull request. I'd be happy to review and incorporate your changes.
This project is licensed under the MIT License.
