Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
Is your feature request related to a problem? Please describe.
Currently it's only possible to define static arp entries when a dhcp server is being used, it would be practical to have a core facility that offers access to static arp entries for non-dhcp cases as well.
Describe the solution you like
A generic facility similar to how Aliases are being handled which offers easy to access manual assignments, which can also be used by other components if they want to register static entries.
Describe alternatives you considered
Reuse the dhcp static assignments, which should at some point also be migrated (to kea?) with the eol notice of isc-dhcp. If we can "plug" entries, it should also be easy to show the current entries from dhcpd in the same area.
Additional context
Relevant current code paths:
|
interfaces_staticarp_configure($dhcpif, $ifconfig_details); |
|
function interfaces_staticarp_configure($if, $ifconfig_details = null) |
|
{ |
|
global $config; |
|
|
|
$ifcfg = $config['interfaces'][$if]; |
|
if (empty($ifcfg['if']) || !isset($ifcfg['enable'])) { |
|
return; |
|
} |
|
|
|
if (empty($ifconfig_details)) { |
|
$ifconfig_details = legacy_interfaces_details($ifcfg['if']); |
|
} |
|
|
|
if (empty($ifconfig_details[$ifcfg['if']])) { |
|
return; |
|
} |
|
|
|
$have = in_array('staticarp', $ifconfig_details[$ifcfg['if']]['flags']); |
|
$want = isset($config['dhcpd'][$if]['staticarp']); |
|
|
|
if ($have !== $want) { |
|
mwexecf('/sbin/ifconfig %s %sstaticarp', [$ifcfg['if'], $want ? '' : '-']); |
|
mwexecf('/usr/sbin/arp -d -i %s -a', [$ifcfg['if']]); |
|
} |
|
|
|
if (isset($config['dhcpd'][$if]['staticmap'])) { |
|
foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) { |
|
if (!$want && !isset($arpent['arp_table_static_entry'])) { |
|
continue; |
|
} |
|
if (!isset($arpent['ipaddr'])) { |
|
continue; |
|
} |
|
mwexecf('/usr/sbin/arp -s %s %s', [$arpent['ipaddr'], $arpent['mac']]); |
|
} |
|
} |
|
} |
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
Is your feature request related to a problem? Please describe.
Currently it's only possible to define static arp entries when a dhcp server is being used, it would be practical to have a core facility that offers access to static arp entries for non-dhcp cases as well.
Describe the solution you like
A generic facility similar to how Aliases are being handled which offers easy to access manual assignments, which can also be used by other components if they want to register static entries.
Describe alternatives you considered
Reuse the dhcp static assignments, which should at some point also be migrated (to kea?) with the eol notice of isc-dhcp. If we can "plug" entries, it should also be easy to show the current entries from dhcpd in the same area.
Additional context
Relevant current code paths:
core/src/etc/inc/plugins.inc.d/dhcpd.inc
Line 650 in 972a7d6
core/src/etc/inc/interfaces.inc
Lines 3821 to 3857 in 972a7d6