Skip to main content

A painfully simple UDP Client/Server for tracking the IP addresses of your devices.

Project description

About DynIP

DynIP is an embarrasingly-simple client and server purely for getting systematic updates of a client’s IP address.

How it works

The client is typically configured to run on a schedule basis using crontab or Windows Scheduled Tasks. When launched, the client sends a UDP datagram to the server, with it’s hostname in the data packet.

The server, when it receives the UDP datagram, opens a JSON file at the path specified in the CLIENT_LOG_PATH. The server looks to see if the client name (the data portion of the packet) is already in the list of known addresses. If it is, it updates the record with the new IP address from the packet header and the current date and time. If it is new, it adds it to the dict of known hosts.

Installation

Either download the package from PyPi, or use easy_install:

$ easy_install DynIP

Usage

Configuration

First, build a configuration file to start from:

$ dynip-init [path for configuration file]

DynIP will create a configuration file at the path you specify.

To configure the server, copy or edit the .conf file and set the server_ip, server_port and client_log_path parameters in the DynIP:Server section. Descriptions of each are in the .conf file.

Launching the Server

Start the server by typing:

$ dynipd [path to .conf file]

The server will endlessly listen for packets until it is killed (by pressing CTRL-C if you launched it in the foreground, or killing it by the PID if you launched it in the background).

Launching the Client

To launch the client and have it fire off a UDP packet, edit your .conf file, and modify the server_hostname and server_port lines in the DynIP:Client section. Descriptions of each are in the code.

Then launch the client by typing:

$ dynipc [path to .conf file]

The client will fire a single UDP packet to the server. The server will then save the hostname, ip address and date/time in the file specified in client_log_path in the .conf file.

Options

To enable verbose (INFO-level) logging, add -v to the command line when launching the server or client.

$ dynipd -v [path to .conf file]
$ dynipc -v [path to .conf file]

To enable debug (DEBUG-level) logging, add –debug to the command line when launching the server or client.

$ dynipd --debug [path to .conf file]
$ dynipc --debug [path to .conf file]

Both the server and client return usage information if you add –help or -h to the command line when invoking the client or server.

Why I Built It

I am about to go on an extended trip away from home, yet need to know the dynamic IP address that is assigned to my home cable router so that I can easily help my family remotely in case they need help with their computers. In order to do this, I need to know the IP address that my cable provider as assigned to my cable modem.

By installing the client on each of my computers at home and triggering the client to run every 5 minutes, the server will always keep a log of the most recent public IP address of the boundary device.

License

DynIP is licensed under the BSD License. See the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DynIP-0.1e.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DynIP-0.1e-py2.7.egg (16.6 kB view details)

Uploaded Egg

File details

Details for the file DynIP-0.1e.tar.gz.

File metadata

  • Download URL: DynIP-0.1e.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for DynIP-0.1e.tar.gz
Algorithm Hash digest
SHA256 5fbbd56338c169b6365f77e288e7802bfccb2d6ae47dc4f9708aa44f4d604c37
MD5 b60fa78d699cc5f9b1bfa6b0bf6ec7bd
BLAKE2b-256 c2bedd8ad6e1e726419c15d1b899614ba2da0c95f58c915da161060edb90278a

See more details on using hashes here.

File details

Details for the file DynIP-0.1e-py2.7.egg.

File metadata

  • Download URL: DynIP-0.1e-py2.7.egg
  • Upload date:
  • Size: 16.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for DynIP-0.1e-py2.7.egg
Algorithm Hash digest
SHA256 def6ca922bd73b2d175f54ba4a307d44b45c3c4fdfecbcc2bb2671948808c60e
MD5 9eed9b668cedc63adb2ef8e02d3b6950
BLAKE2b-256 bd1ae35c667c1b3a48726e105dd928ba6f18e46c0a8741a2f85bb665fcb95a2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page