1.1.10 • Published 4 years ago

dhcpd v1.1.10

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

dhcpd

Introduce

NodeJS pagckage for managing DHCPD

Installation

npm i --save dhcpd

!Important

Please notice this package will compile and install isc-dhcp(ver-4.4.2) to your machine(if no dhcpd binary found), therefore, make sure your compile tools' ready.

Simple Usage

Import the package
import {Dhcpd} from 'dhcpd'

or

const {Dhcpd} = require('dhcpd);
Setup DHCP server
//CIDR
const dhcpd = new Dhcpd({
	interface: 'en9',
	cidr: '172.0.0.1/24'
})
dhcpd.start().then(() => {
	console.log('DHCPD started')
}).catch(e => {
	console.error(e)
})
Or
const dhcpd = new Dhcpd({
	interface: 'en9',
	range: [
		"192.168.3.10", "192.168.3.99"
	],
	static: [
		{
			hostname: 'host1',
			macAddress: 'xx:xx:xx:xx:xx:xx',
			ipAddress: '192.168.3.2'
		}
	],
	network: '192.168.3.0',
	netmask: '255.255.255.0',
	router: '192.168.3.1',
	dns: ["8.8.8.8", "8.8.4.4"],
	broadcast: '192.168.3.255'
})
dhcpd.start().then(() => {
	console.log('DHCPD started')
}).catch(e => {
	console.error(e)
})

API

start()

(returns a promise) start the server

stop()

(returns a promise) stop the server

getInterface()

get DHCP service binding network interface

getRouter()

get router address

getNetMask()

get network mask

getNetwork()

get network address

getDNS()

get DNS address array

getBroadcast()

get broadcast address

License

MIT

1.1.9

4 years ago

1.1.10

4 years ago

1.1.8

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago