Skip to content

Monitor traffic and disable hardware when a treshhold is reached.

Notifications You must be signed in to change notification settings

remcoeijsackers/Netlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 

Repository files navigation

Netlock

Monitor network traffic and disable hardware when a threshhold in bytes is reached.

Installation

in the repo root run;

sudo ./Netlock/setup.sh

Note: if you experience issues after installation, please restart the shell (or open a new one)

Usage

Tests

Test if interface has a network connection

netlock -t interface

netlock -t en0

Interface state

Disable all network interfaces

netlock -n

Enable all network interfaces

netlock -d

Monitoring

Monitor without limits

netlock -m interface bytes-out bytes-in

netlock -m en0

Monitor, disable network hardware when limit is reached

Note: The limit is defined in bytes.

netlock -m interface bytes-out bytes-in

netlock -m en0 5 5

Monitor, disable all network hardware when limit is reached

Note: The limit is defined in bytes.

netlock -m interface bytes-out bytes-in safe

netlock -m en0 5 5 safe

Monitor, clean output

will return an output of just the bytes, no formatting.

usefull for piping into other utilities.

netlock -c en0 out

Options

  • -v version: display version info
  • -h help: display help
  • -t test connection: test if connected to the internet
    • Arg1: Network Interface ('en0')
  • -n nuke hardware: disconnect all interfaces
  • -d denuke hardware: reconnect all interfaces
  • -m monitor traffic
    • Arg1: Network Interface
    • Arg2: (optional) Bytes Out limit (Interface will be disabled if limit is reached)
    • Arg3: (optional) Bytes In limit (Interface will be disabled if limit is reached)
    • Arg4: (optional) 'safe' turns off all network interfaces if limit is reached.
  • -c clean output: get clean output from an interface
    • Arg1: Network Interface ('en0')
    • Arg2: in or outgoing traffic ('in' 'out')

About

Monitor traffic and disable hardware when a treshhold is reached.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages