forked from FF-RGB/ansible
Optimize arp broadcasts via dhcp hooks
This commit is contained in:
parent
2071508f1f
commit
7dc86c4c16
@ -28,4 +28,18 @@ subnet {{ batman_ipv4 | ipaddr('network') }} netmask {{ batman_ipv4 | ipaddr('ne
|
|||||||
pool {
|
pool {
|
||||||
range {{ dhcpd_first }} {{ dhcpd_last }} ;
|
range {{ dhcpd_first }} {{ dhcpd_last }} ;
|
||||||
}
|
}
|
||||||
|
# use static arp entries to reduce broadcast
|
||||||
|
on commit {
|
||||||
|
set clip = binary-to-ascii(10, 8, ".", leased-address);
|
||||||
|
set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
|
||||||
|
execute("/sbin/arp", "-s", clip, clhw);
|
||||||
|
}
|
||||||
|
on release {
|
||||||
|
set clip = binary-to-ascii(10, 8, ".", leased-address);
|
||||||
|
execute("/sbin/arp", "-d", clip);
|
||||||
|
}
|
||||||
|
on expiry {
|
||||||
|
set clip = binary-to-ascii(10, 8, ".", leased-address);
|
||||||
|
execute("/sbin/arp", "-d", clip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user