Skip to content

A simple Rust application that captures and monitors network packets on a specified network interface, periodically printing and saving packet metrics to a JSON file.

Notifications You must be signed in to change notification settings

JeromeWolff/network-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

network-monitor

A simple Rust application that captures and monitors network packets on a specified network interface, periodically printing and saving packet metrics to a JSON file.

Features

  • Captures packets on a specified network interface.
  • Counts the total packets and bytes captured.
  • Outputs metrics to the console every 5 seconds.
  • Saves metrics snapshots to a JSON file (metrics.json).

Prerequisites

  • Rust: Ensure that Rust is installed. Install Rust
  • pnet crate: This application uses the pnet crate for network interface handling and packet processing.

Installation

  1. Clone the repository:

    git clone https://github.com/JeromeWolff/network-monitor.git
    cd network-monitor
  2. Build the project:

    cargo build --release

Usage

Run the application by specifying a network interface to capture packets on. You can find available interfaces using the ip a command on Linux.

cargo run --release <interface_name>

Replace <interface_name> with the name of the network interface to capture packets on.

Contributing

Contributions are welcome! Please open an issue to discuss what you would like to change.

Contributors

JeromeWolff
Jerome Wolff

About

A simple Rust application that captures and monitors network packets on a specified network interface, periodically printing and saving packet metrics to a JSON file.

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages