Skip to content

Shell scripts to automate the configuration of Deeper Network devices

Notifications You must be signed in to change notification settings

djfil/DeeperNetworkCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deeper Network CLI (ALPHA)

Collection of command line scripts composing an UNOFFICIAL Command Line Interface for the Deeper Network devices. All derived from the GUI. It can handle most stats, some configurations and some actions, like reboot. It is written using only curl requests in bash, so it should work on any linux distro. You may also use a docker image to run this script. See the Docker section for more information.

Disclaimer

This is a mostly untested work in progress. Use at your own risk.

Features

  • Thought to work only withtin your network, no external dependencies.
  • Handles ip ranges (in CIDR) and lists of arguments, where GUI can only handle a single IP or domain.
  • You can send info log messages to the device.
  • Host is set through env var DEEPER_API_HOST(defaults to 34.34.34.34)

Requirements

  • Docker (optional)
  • Linux Shell (if not using docker)
  • Curl (if not using docker)

Usage

Docker (used for testing)

  1. Build the image

        docker build -t deeper-network-cli:alpha .
  2. Run the image

        docker run --rm deeper-network-cli:alpha <IP RANGE> <COUNTRY CODE> <USERNAME> <PASSWORD>

    It only adds, for the moment. If you wish to delete using docker image just edit the dockerfile and switch the comment between lines 10 and 11. And off course build the image again.

  3. You could also change the entrypoint script at runtime and use any of the Shell section scripts:

        docker run --rm --entrypoint ./opt/<SCRIPT>.sh deeper-network-cli:alpha <ARGUMENTS>

    Example:

        docker run --rm --entrypoint ./opt/getToken.sh deeper-network-cli:alpha teste paswword

Shell

Get Device ID

 ./getDeviceId.sh <USERNAME> <PASSWORD>

Get DPN Mode

 ./getDpnMode.sh <USERNAME> <PASSWORD>

Get Token (login)

 ./getToken.sh <USERNAME> <PASSWORD>

List Tunnels

 ./listTunnels.sh <USERNAME> <PASSWORD>

Add Tunnels

 ./addTunnel.sh <LIST REGION COUNTRY CODE PAIRS> <USERNAME> <PASSWORD>

Example:

 ./addTunnels.sh "AMN BM ASC KG" teste password

Delete Tunnels

 ./deleteTunnels.sh [LIST COUNTRY CODE] <USERNAME> <PASSWORD>

Example:

 ./deleteTunnels.sh "BM KG" teste password

Add IP to the White List

 ./addToWhiteList.sh <IP RANGE> <COUNTRY CODE> <USERNAME> <PASSWORD>

Remove IP from the White List

 ./deleteFromWhiteList.sh <IP RANGE> <USERNAME> <PASSWORD>

Set DPN Mode (full, smart, disabled)

 ./setDpnMode.sh <DPN MODE> <USERNAME> <PASSWORD>
 ./setDpnMode.sh full <COUNTRY CODE> <USERNAME> <PASSWORD>

Get IP Routing Black List.

 ./getRoutingBlackList.sh <USERNAME> <PASSWORD>

Get IP Routing White List

 ./getRoutingWhiteList.sh <USERNAME> <PASSWORD>

Add Donain to the White List

 ./addDomainToWhiteList.sh [DOMAIN TUNNEL PAIR] <USERNAME> <PASSWORD>

Example:

 ./addDomainToWhiteList.sh "google.com AMN whatsmyip.org AMN" teste password

Delete Domain from the White List

 ./deleteDomainFromWhiteList.sh [DOMAINS] <USERNAME> <PASSWORD>

Example:

 ./deleteDomainFromWhiteList.sh "google.com whatsmyip.org" teste password

Add IP Range to the Black List

 ./addIpRangeToBlackList.sh <IP RANGE> <USERNAME> <PASSWORD>

Example:

 ./addIpRangeToBlackList.sh 1.1.1.1/32 teste password

Delete IP Range from the Black List

 ./deleteIpRangeFromBlackList.sh <IP RANGE> <USERNAME> <PASSWORD>

Example:

 ./deleteIpRangeFromBlackList.sh 1.1.1.1/32 teste password

Special Thanks

  • Andrei Menshikh

About

Shell scripts to automate the configuration of Deeper Network devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published