Skip to content

Commit

Permalink
change default ra interval to 200 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyc committed Dec 31, 2024
1 parent 10233ec commit 54aa699
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/dhcp/dhcp6_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DHCP6Plugin extends DHCPPlugin {
this._restartService();
}

async writeDHCPConfFile(iface, tags, type = "stateless", from, to, nameservers, prefixLen, leaseTime = 86400) {
async writeDHCPConfFile(iface, tags, type = "stateless", from, to, nameservers, prefixLen, leaseTime = 86400, raInterval = 200) {
tags = tags || [];
nameservers = nameservers || [];
let extraTags = "";
Expand All @@ -59,7 +59,7 @@ class DHCP6Plugin extends DHCPPlugin {
// simply use slaac to configure client IPv6 address
content.push(`dhcp-range=tag:${iface},${extraTags}::,constructor:${this.name},slaac,${leaseTime}`);
content.push('enable-ra');
content.push(`ra-param=${iface},15,3600`);
content.push(`ra-param=${iface},${raInterval},3600`);
break;
}
case "stateful": {
Expand All @@ -69,7 +69,7 @@ class DHCP6Plugin extends DHCPPlugin {
this.fatal(`prefixLen for dhcp6 of ${this.name} should be at least 64`);
content.push(`dhcp-range=tag:${iface},${extraTags}${from},${to},${prefixLen},${leaseTime}`);
content.push('enable-ra');
content.push(`ra-param=${iface},15,3600`);
content.push(`ra-param=${iface},${raInterval},3600`);
break;
}
default:
Expand All @@ -94,7 +94,7 @@ class DHCP6Plugin extends DHCPPlugin {
return;
}
await this.writeDHCPConfFile(iface, this.networkConfig.tags, this.networkConfig.type, this.networkConfig.range && this.networkConfig.range.from, this.networkConfig.range && this.networkConfig.range.to, this.networkConfig.nameservers,
this.networkConfig.prefixLen, this.networkConfig.lease);
this.networkConfig.prefixLen, this.networkConfig.lease, this.networkConfig.raInterval);
this._restartService();
}
}
Expand Down

0 comments on commit 54aa699

Please sign in to comment.