Eltrafico
Eltrafico copied to clipboard
NetLimiter-like traffic shaping for Linux
Eltrafico
NetLimiter-like traffic shaping for Linux
This is a port of https://github.com/cryzed/TrafficToll to rust.
And a gui on top
With network usage:
The default frontend is GTK, other frontends can be written:
- bandito

- Traffictoll: https://github.com/sigmaSd/Eltrafico/tree/master/frontend/traffictoll
Usage
eltrafico
Howto
Choose the correct interface, and eltrafico will monitor it for active connections
Active program will automatically show up
Choose your limits then activate it by toggling the corresponding checkbox on.
If bandwhich or nethogs is installed on your system, eltrafico will use it automatically to show programs live network usage
You can run eltrafico with --advanced flag to get more options in the gui
Technical details
Eltrafico is split on 2 crates that communicate through stdin/out:
1- crates/gui: create gui and call bandwhich/nethogs and eltrafico_tc as privileged process using pkexec
2- crates/tc: traffic shaping, can be controlled via stdin, for the list of commands see (TODO)https://github.com/sigmaSd/Eltrafico/blob/sudo_isolation/src/eltrafico_tc/main.rs#L252 and (TODO)https://github.com/sigmaSd/Eltrafico/blob/sudo_isolation/src/eltrafico_tc/main.rs#L79
This allows to run the gui as a normal user, and ask for higher privilege only for eltrafico_tc and bandwhich/nethogs binaries
eltrafico_tc needs to be in $PATH or you can specify a custom path via --eltrafico-tc $path_to_binary
pkexec usage:
- pkexec eltrafico_tc
- pkexec bandhwich
- pkexec nethogs
- pkexec pkill nethogs
- pkexec pkill bandwhich
Hacking tips
When developping make sure to use env RUST_LOG=debug
Current State
Works on my pc (TM)
Dependencies
iproute2
optional:
Binary Releases
- Automatic releases by github actions are uploaded here https://github.com/sigmaSd/eltrafico/releases
Community Packages
- Arch aur (by @fanzhuyifan): eltrafico-git
Installation
- needs gtk-dev: https://gtk-rs.org/docs/requirements.html
- cargo install eltrafico
Building/Dev
- needs gtk-dev: https://gtk-rs.org/docs/requirements.html
- cargo b
- cargo r --bin gui -- --eltrafico-tc target/debug/eltrafico_tc
Its a good idea to set RUST_LOG=trace when devoloping