代码拉取完成,页面将自动刷新
NodeJS pagckage for managing DHCPD
npm i --save dhcpd
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.
import {Dhcpd} from 'dhcpd'
or
const {Dhcpd} = require('dhcpd);
//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)
})
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)
})
(returns a promise) start the server
(returns a promise) stop the server
get DHCP service binding network interface
get router address
get network mask
get network address
get DNS address array
get broadcast address
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。