This will generate a very basic DHCP config with use of PHPIPAM systems.

Overview

phpipam-dhcp-config-generator

This will generate a very basic DHCP config with use of PHPIPAM systems.

Requirements

PHPIPAM

  • Custom Fields
    • domain_name (Optional)
    • static_percentage
    • **next_server (Optional)
    • **bootfile_name (Optional, but you cannot have a next_server with not bootfile_name)
    • A username/password and application with API access
    • PHPIPAM prettify links

DHCPD

  • **dhcpd-reservations.include (This file MUST exist and MUST be located in /etc/dhcp)

 

Usage

To use this, simply execute the generate_dhcp_config.py script with the necessary arguments.

 

Notes

Asterisks next to requirements indicate that this is easily changeable to suit your needs.

  • next_server
    • This is optional in PHPIPAM and you can specify this in the Jinja2 template manually.
  • bootfile_name
    • This is optional in PHPIPAM and you can specify this in the Jinja2 template manually.
  • dhcpd-reservations.include
    • This is optional and the include line can be removed from the Jinja2 template or the location can be changed manually.
    • You can also manually modify this file to fit your needs if you do intend to use it.

I mean, really, it's all optional and can be specified manually, but why not let PHPIPAM handle the load?

You might also like...
A simple tool to utilize the basic functionality of the Private API From Virus Total

Welcome To VT-SCAN (viurs total api) Information This is a simple tool to utilize the basic functionality of the Private API From Virus Total. with th

Azure-function-proxy - Basic proxy as an azure function serverless app

azure function proxy (for phishing) here are config files for using *[.]azureweb

Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect
Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect

wifi-password Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect. Works on macOS and Li

A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

This application aims to read all wifi passwords and visualizes the  complexity in graph formation by taking into account several criteria and help you generate new random passwords.
This application aims to read all wifi passwords and visualizes the complexity in graph formation by taking into account several criteria and help you generate new random passwords.

This application aims to read all wifi passwords and visualizes the complexity in graph formation by taking into account several criteria and help you generate new random passwords.

stellar-add-guest is a small tool to generate a new guest for Stellar Wireless (Enterprise mode) in OmniVista 2500 hosted on OmniSwitch with AOS Release 8
stellar-add-guest is a small tool to generate a new guest for Stellar Wireless (Enterprise mode) in OmniVista 2500 hosted on OmniSwitch with AOS Release 8

stellar-add-guest is a small tool to generate a new guest for Stellar Wireless (Enterprise mode) in OmniVista 2500 hosted on OmniSwitch with AOS Release 8.

A tool to generate valid ip addresses of 55 countries. These ip's can be used for OpenBullet.
A tool to generate valid ip addresses of 55 countries. These ip's can be used for OpenBullet.

IP-Grabber A tool to generate valid ip addresses of 55 countries. These ip's can be used for OpenBullet. ive added the feature to set the generated ip

An ftp syncing python package that I use to sync pokemon saves between my hacked 3ds running ftpd and my server

Sync file pairs over ftp and apply patches to them. Useful for using ftpd to transfer ROM save files to and from your DS if you also play on an emulator. Setup a cron job to check for your DS's ftp server periodically to setup automatic syncing. Untested on windows. It may just work out of the box, unsure though.

Use Raspberry Pi and CircuitSetup's power monitor hardware to publish electrical usage to MQTT
Use Raspberry Pi and CircuitSetup's power monitor hardware to publish electrical usage to MQTT

This repo has code and notes for whole home electrical power monitoring using a Raspberry Pi and CircuitSetup modules. Beyond just collecting data, it

Comments
  • Fixing datetime issue and error checking mentioned in Issue #1

    Fixing datetime issue and error checking mentioned in Issue #1

    This will fix the datetime issue and add some error checking for a more clear answer as to why it failed. See issue #1 for further understanding of related error.

    TL;DR: Fixes #1

    opened by hunoz 0
  • IPAMObject has no attribute

    IPAMObject has no attribute "dhcp_range"

    I tested it without success. I run it like this: sudo python3 generate_dhcp_config.py -u admin -p password -e http://192.168.0.31:8080 -a ipam When i run above command i get error: AttributeError: module 'datetime' has no attribute 'now' To solve that i added line: from datetime import datetime

    Second problem, when i ran above command ( I have DHCP range defined in phpipam):

    Backing up original config.
    Original config backed up.
    Getting subnet DHCP data.
    {'id': '141', 'subnet': '192.168.10.0', 'mask': '25', 'sectionId': '1', 'description': ' testib', 'linked_subnet': None, 'firewallAddressObject': None, 'vrfId': '0', 'masterSubnetId': '0', 'allowRequests': '0', 'vlanId': '3', 'showName': '0', 'device': '0', 'permissions': [{'group_id': 3, 'permission': '1', 'name': 'Guests', 'desc': 'default Guest group (viewers)', 'members': False}, {'group_id': 2, 'permission': '2', 'name': 'Operators', 'desc': 'default Operator group', 'members': False}], 'pingSubnet': '0', 'discoverSubnet': '0', 'resolveDNS': '0', 'DNSrecursive': '0', 'DNSrecords': '0', 'nameserverId': '0', 'scanAgent': '0', 'customer_id': None, 'isFolder': '0', 'isFull': '0', 'tag': '2', 'threshold': '0', 'location': [], 'editDate': '2022-01-29 14:33:49', 'lastScan': None, 'lastDiscovery': None}
    {'id': '141', 'subnet': '192.168.10.0', 'mask': '25', 'sectionId': '1', 'description': ' testib', 'linked_subnet': None, 'firewallAddressObject': None, 'vrfId': '0', 'masterSubnetId': '0', 'allowRequests': '0', 'vlanId': '3', 'showName': '0', 'device': '0', 'permissions': [{'group_id': 3, 'permission': '1', 'name': 'Guests', 'desc': 'default Guest group (viewers)', 'members': False}, {'group_id': 2, 'permission': '2', 'name': 'Operators', 'desc': 'default Operator group', 'members': False}], 'pingSubnet': '0', 'discoverSubnet': '0', 'resolveDNS': '0', 'DNSrecursive': '0', 'DNSrecords': '0', 'nameserverId': '0', 'scanAgent': '0', 'customer_id': None, 'isFolder': '0', 'isFull': '0', 'tag': '2', 'threshold': '0', 'location': [], 'editDate': '2022-01-29 14:33:49', 'lastScan': None, 'lastDiscovery': None}
    {'id': '141', 'subnet': '192.168.10.0', 'mask': '25', 'sectionId': '1', 'description': ' testib', 'linked_subnet': None, 'firewallAddressObject': None, 'vrfId': '0', 'masterSubnetId': '0', 'allowRequests': '0', 'vlanId': '3', 'showName': '0', 'device': '0', 'permissions': [{'group_id': 3, 'permission': '1', 'name': 'Guests', 'desc': 'default Guest group (viewers)', 'members': False}, {'group_id': 2, 'permission': '2', 'name': 'Operators', 'desc': 'default Operator group', 'members': False}], 'pingSubnet': '0', 'discoverSubnet': '0', 'resolveDNS': '0', 'DNSrecursive': '0', 'DNSrecords': '0', 'nameserverId': '0', 'scanAgent': '0', 'customer_id': None, 'isFolder': '0', 'isFull': '0', 'tag': '2', 'threshold': '0', 'location': [], 'editDate': '2022-01-29 14:33:49', 'lastScan': None, 'lastDiscovery': None}
    {'id': '141', 'subnet': '192.168.10.0', 'mask': '25', 'sectionId': '1', 'description': ' testib', 'linked_subnet': None, 'firewallAddressObject': None, 'vrfId': '0', 'masterSubnetId': '0', 'allowRequests': '0', 'vlanId': '3', 'showName': '0', 'device': '0', 'permissions': [{'group_id': 3, 'permission': '1', 'name': 'Guests', 'desc': 'default Guest group (viewers)', 'members': False}, {'group_id': 2, 'permission': '2', 'name': 'Operators', 'desc': 'default Operator group', 'members': False}], 'pingSubnet': '0', 'discoverSubnet': '0', 'resolveDNS': '0', 'DNSrecursive': '0', 'DNSrecords': '0', 'nameserverId': '0', 'scanAgent': '0', 'customer_id': None, 'isFolder': '0', 'isFull': '0', 'tag': '2', 'threshold': '0', 'location': [], 'editDate': '2022-01-29 14:33:49', 'lastScan': None, 'lastDiscovery': None}
    Traceback (most recent call last):
      File "generate_dhcp_config.py", line 136, in <module>
        print(main())
      File "generate_dhcp_config.py", line 128, in main
        result = run.create_config()
      File "generate_dhcp_config.py", line 96, in create_config
        config = self._dhcp_config_generator()
      File "generate_dhcp_config.py", line 53, in _dhcp_config_generator
        ranges = self._get_subnet_dhcp_ranges()
      File "generate_dhcp_config.py", line 44, in _get_subnet_dhcp_ranges
        dhcp_range = subnet_info.dhcp_range
      File "/home/imre/phpipam-dhcp-config-generator-main/classes.py", line 61, in __getattr__
        raise AttributeError(f'{__class__.__name__} has no attribute "{key}"')
    AttributeError: IPAMObject has no attribute "dhcp_range"
    
    opened by impsik 6
Owner
null
wireguard-config-benchmark is a python script that benchmarks the download speeds for the connections defined in one or more wireguard config files

wireguard-config-benchmark is a python script that benchmarks the download speeds for the connections defined in one or more wireguard config files. If multiple configs are benchmarked it will output a file ranking them from fastest to slowest.

Sal 12 May 7, 2022
Minimal, self-hosted, 0-config alternative to ngrok. Caddy+OpenSSH+50 lines of Python.

If you have a webserver running on one computer (say your development laptop), and you want to expose it securely (ie HTTPS) via a public URL, SirTunnel allows you to easily do that.

Anders Pitman 423 Jan 2, 2023
This is simple script that changes the config register of a cisco router over serial so that you can reset the password

Cisco-router-config-bypass-tool- This is simple script that changes the config register of a cisco router over serial so that you can bypass the confi

James 1 Jan 2, 2022
Very simple FTP client, sync folder to FTP server, use python, opensource

ftp-sync-python Opensource, A way to safe your data, avoid lost data by Virus, Randsomware Some functions: Upload a folder automatically to FTP server

null 4 Sep 13, 2022
JF⚡can - Super fast port scanning & service discovery using Masscan and Nmap. Scan large networks with Masscan and use Nmap's scripting abilities to discover information about services. Generate report.

Description Killing features Perform a large-scale scans using Nmap! Allows you to use Masscan to scan targets and execute Nmap on detected ports with

null 377 Jan 3, 2023
Autopen is a very modular tool that automates the execution of scans during a penetration test.

Autopen Autopen is a very modular tool that automates the execution of scans during a penetration test. A Nmap scan result in the form of an XML file

null 2 Dec 22, 2021
Very simple and tiny file sharing service written in python

Simple File sharing tool Sharing client usage (You will need to use python3 for linux) main.py --send -f file/path Optionnal flags : pwd : set a passw

null 2 Jul 26, 2022
Passive TCP/IP Fingerprinting Tool. Run this on your server and find out what Operating Systems your clients are *really* using.

Passive TCP/IP Fingerprinting This is a passive TCP/IP fingerprinting tool. Run this on your server and find out what operating systems your clients a

Nikolai Tschacher 158 Dec 20, 2022
Simple self-hosted server to receive files from remote systems

Badtray This is a very simple self-hosted server to receive files from remote systems. This works similar to Bintray (RIP) and primarily designed to d

Alex Taradov 1 Nov 22, 2021
This tool extracts Credit card numbers, NTLM(DCE-RPC, HTTP, SQL, LDAP, etc), Kerberos (AS-REQ Pre-Auth etype 23), HTTP Basic, SNMP, POP, SMTP, FTP, IMAP, etc from a pcap file or from a live interface.

This tool extracts Credit card numbers, NTLM(DCE-RPC, HTTP, SQL, LDAP, etc), Kerberos (AS-REQ Pre-Auth etype 23), HTTP Basic, SNMP, POP, SMTP, FTP, IMAP, etc from a pcap file or from a live interface.

null 1.6k Jan 1, 2023