diff --git a/lib/dhcp.js b/lib/dhcp.js index e009e81..68f4adb 100644 --- a/lib/dhcp.js +++ b/lib/dhcp.js @@ -287,7 +287,10 @@ Server.prototype = { } else if (_static[clientMAC]) { return _static[clientMAC]; } - + + const _ignoreRange = this.config('ignoreRange'); + if(_ignoreRange) + return false; const randIP = this.config('randomIP'); const _tmp = this.config('range'); @@ -363,7 +366,9 @@ Server.prototype = { lease.server = this.config('server'); lease.state = 'OFFERED'; - this.sendOffer(req); + if(lease.address) { + this.sendOffer(req); + } }, sendOffer: function(req) { @@ -408,7 +413,9 @@ Server.prototype = { lease.state = 'BOUND'; lease.bindTime = new Date; - this.sendAck(req); + if(lease.address) { + this.sendAck(req); + } }, sendAck: function(req) { //console.log('Send ACK'); diff --git a/lib/options.js b/lib/options.js index b5f597a..5b0c168 100644 --- a/lib/options.js +++ b/lib/options.js @@ -537,6 +537,12 @@ const opts = { type: 'Bool', config: 'randomIP', default: true + }, + 9999: { + name: 'Ignore Range', + type: 'Bool', + config: 'ignoreRange', + default: false } };