GithubHelp home page GithubHelp logo

zingerlittlebee / netop Goto Github PK

View Code? Open in Web Editor NEW
161.0 2.0 7.0 2.32 MB

Network Top -- Help you monitor network traffic with bpf

Home Page: https://crates.io/crates/netop

License: MIT License

Rust 95.84% Dockerfile 4.16%
cli network traffic terminal rust

netop's Introduction

Language : 🇺🇸 English | 🇨🇳 简体中文

netop

Docker Pulls Docker Image Size Docker Image Version (latest by date)

GitHub Workflow Status Last Commit LICENSE

Overview

netop is a terminal command line interface that can customize the filter network traffic rule 🎯

Features

  • Use the bpf rule filter
  • Multi-rule switching
  • Real-time rate
  • Total traffic
  • Response UI
  • Resource occupation is small, rust Written
  • Support docker deployment

Installation

Docker

docker run -it --rm --net=host zingerbee/netop

Cargo

need rust and pcap, detail look at How to build

# install
sudo cargo install netop
# and then run
netop
# or designated network interface card running
netop -n eth0

NetBSD

On NetBSD there's an official package available. To install a pre-compiled binary, simply run

pkgin install netop

Or, if you prefer to build it from source,

cd /usr/pkgsrc/net/netop
make install

How to use

  • Press e to enter edit mode input bpf rule, and then press enter
  • Press Esc to exit edit mode
  • Use the <- or -> to switch between different rules
  • Not in edit mode, press dd to delete current rule
  • Not in edit mode, press q to quit

View help

netop -h
# docker
docker run -it --rm --net=host zingerbee/netop -h

Output as follows

netop 0.1.4

USAGE:
    netop [OPTIONS]

OPTIONS:
    -h, --help           Print help information
    -n, --name <NAME>    Name of Network Interface Card
    -V, --version        Print version information

Designated network interface card running

The parameter is name of network interface card

*unix: Use ifconfig to view network interface cards information

windows: Use ipconfig to view network interface cards information

netop -n eth0
# docker
docker run -it --rm --net=host zingerbee/netop -n eth0

How to build from source

Development environment

  • It is best to be root user, pcap requires permissions
  • rust >= 1.40.0
  • pcap
    • Ubuntu、Debian: apt install libpcap-dev
    • MacOS: installed by default
    • Windows: Download the WinPcap Developer's Pack. Add the /Lib or /Lib/x64 folder to your LIB environment variable.
sudo cargo install --path .
# or
sudo cargo run

Found an issue or have a proposal

Create an issue

Release Notes

SEE CHANGELOG

netop's People

Contributors

0323pin avatar kz6fittycent avatar renovate-bot avatar renovate[bot] avatar zingerlittlebee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

netop's Issues

Release when?

Hi,
Are you planning a new release anytime soon?
Would be nice to at least update the dependencies without the need to build from git-HEAD.

Regards

NetBSD package ready

Hi,

I've just packaged and built netop on my NetBSD machine.

2022-06-18-112422_1366x768_scrot

I'll import the package to the main pkgsrc branch soon.
Would you mind removing Cargo.lock from gitignore, so the file is hosted in the repository?
The reason for this is that we have a script that reads Cargo.lock and generates a list of dependency crates. Without Cargo.lock I need to do this manually.
Thanks!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • netraffic 0.1.0
  • crossterm 0.27.0
  • chrono 0.4
  • clap 4.4.11
  • ratatui 0.25.0
dockerfile
deploy/Dockerfile
github-actions
.github/workflows/docker.yml
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/build-push-action v5
.github/workflows/publish.yml
  • actions/checkout v4
  • actions-rs/toolchain v1
.github/workflows/rust-clippy.yml
  • actions/checkout v4
  • actions-rs/toolchain v1@16499b5e05bf2e26879000db0c1d13f7e13fa3af
  • github/codeql-action v3

  • Check this box to trigger a request for Renovate to run again on this repository

Provide a debian package

Create and provide a debian package for debian stable if possible or for testing (next stable).

socket permission error

While looking for a tool to network request viewer tool, i found this which lookes like what i need (cli and simple). I installed it without using sudo. When running i get the follwing error: It spits it out overlayed with a first paint of the UI which is why the horizontal lines are in there:

│hread '<unnamed>' panicked at '││lled `Result::unwrap()` on an `││r` valu│: PcapError("socket: Operation not permitted")', /home/n││/.local/share/rtx/installs/rust││.67.1/registry/src/github.com-1││0.0MB/s│ec823/netraffic-0.1.0/src/lib.rs:133:18                 │

A deprecated call

warning: use of deprecated method `ratatui::widgets::List::<'a>::start_corner`: You should use `List::direction` instead.
   --> src/ui.rs:221:10
    |
221 |         .start_corner(Corner::BottomLeft);
    |          ^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: `netop` (bin "netop") generated 1 warning

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.