return false;
}
+function has_sourcefilter(proto) {
+ switch (proto) {
+ case '3g':
+ case 'dhcpv6':
+ case 'directip':
+ case 'mbim':
+ case 'ncm':
+ case 'ppp':
+ case 'pppoa':
+ case 'pppoe':
+ case 'pptp':
+ case 'qmi':
+ return true;
+ }
+
+ return false;
+}
+
var cbiRichListValue = form.ListValue.extend({
renderWidget: function(section_id, option_index, cfgvalue) {
var choices = this.transformChoices();
s.load = function() {
return Promise.all([
network.getNetworks(),
- firewall.getZones()
+ firewall.getZones(),
+ uci.load('system')
]).then(L.bind(function(data) {
this.networks = data[0];
this.zones = data[1];
tdEl.lastChild.childNodes[3].disabled = true;
}
+ if (dynamic) {
+ //disable the 'Edit' button on dynamic interfaces
+ tdEl.lastChild.childNodes[2].disabled = true;
+ }
+
return tdEl;
};
o.nobridges = false;
o.optional = false;
o.network = ifc.getName();
+ o.exclude = '@' + ifc.getName();
+
+ o = s.taboption('general', form.Flag, 'disabled', _('Disable this interface'));
+ o.modalonly = true;
o = s.taboption('general', form.Flag, 'auto', _('Bring up on boot'));
o.modalonly = true;
so.depends('dhcpv6', 'server');
so.depends({ dhcpv6: 'hybrid', master: '0' });
+ //This is a DHCPv6 specific odhcpd setting
+ so = ss.taboption('ipv6', form.DynamicList, 'ntp', _('NTP Servers'),
+ _('DHCPv6 option 56. %s.', 'DHCPv6 option 56. RFC5908 link').format('<a href="%s" target="_blank">RFC5908</a>').format('https://www.rfc-editor.org/rfc/rfc5908#section-4'));
+ so.datatype = 'host(0)';
+ for(var x of uci.get('system', 'ntp', 'server') || '') {
+ so.value(x);
+ }
+ var local_nets = this.networks.filter(function(n) { return n.getName() != 'loopback' });
+ if(local_nets) {
+ // If ntpd is set up, suggest our IP(v6) also
+ if(uci.get('system', 'ntp', 'enable_server')) {
+ local_nets.forEach(function(n){
+ n.getIPAddrs().forEach(function(i4) {
+ so.value(i4.split('/')[0]);
+ });
+ n.getIP6Addrs().forEach(function(i6) {
+ so.value(i6.split('/')[0]);
+ });
+ });
+ }
+ }
+ so.optional = true;
+ so.rmempty = true;
+ so.depends('dhcpv6', 'server');
+ so.depends({ dhcpv6: 'hybrid', master: '0' });
so = ss.taboption('ipv6', cbiRichListValue, 'ndp', _('<abbr title="Neighbour Discovery Protocol">NDP</abbr>-Proxy'),
_('Configures the operation mode of the NDP proxy service on this interface.'));
for (var i = 0; i < rtTables.length; i++)
o.value(rtTables[i][1], '%s (%d)'.format(rtTables[i][1], rtTables[i][0]));
- if (protoval == 'dhcpv6') {
+ if (has_sourcefilter(protoval)) {
o = nettools.replaceOption(s, 'advanced', form.Flag, 'sourcefilter', _('IPv6 source routing'), _('Automatically handle multiple uplink interfaces using source-based policy routing.'));
o.default = o.enabled;
}
s.addremove = false;
s.anonymous = true;
- o = s.option(form.Value, 'ula_prefix', _('IPv6 ULA-Prefix'), _('Unique Local Address - in the range <code>fc00::/7</code>. Typically only within the ‘local’ half <code>fd00::/8</code>. ULA for IPv6 is analogous to IPv4 private network addressing. This prefix is randomly generated at first install.'));
+ o = s.option(form.Value, 'ula_prefix', _('IPv6 ULA-Prefix'),
+ _('Unique Local Address (%s) - prefix <code>fd00::/8</code> (the L bit is always 1).').format('<a href="%s" target="_blank">RFC4193</a>').format('https://datatracker.ietf.org/doc/html/rfc4193#section-3') + ' ' +
+ _('ULA for IPv6 is analogous to IPv4 private network addressing.') + ' ' +
+ _('This prefix is randomly generated at first install.'));
o.datatype = 'cidr6';
o = s.option(form.Flag, 'packet_steering', _('Packet Steering'), _('Enable packet steering across all CPUs. May help or hinder network speed.'));