Quote from: martine on Today at 04:57:24 PMUngern möchte ich die Clients in zwei Netze TeilenDas wäre aber genau die richtige Lösung. Alles andere geht - falls überhaupt - nur mit viel Gebastel und Workarounds.
Quote from: Patrick M. Hausen on December 18, 2025, 06:24:03 PMNotice the small triangles on every tab but the introduction? These open up the menues.
{
"Dhcp6": {
"subnet6": [
{
"id": 1,
"subnet": "2601:xx:xx:xx::\/64",
"pools": [
{
"pool": "2601:xx:xx:xx::0\/120"
}
]
}
]
}
}
#!/bin/sh
# /usr/local/sbin/kea_prefix_change.sh
change_log='/var/log/wan_ipv6_change.log'
FILE_NAME='/root/testing.conf'
# FILE_NAME='/usr/local/etc/kea/kea-dhcp6.conf'
VAR1=$(jq -r '.Dhcp6.subnet6[].subnet' $FILE_NAME)
VAR1="$(echo $VAR1 | cut -d'/' -f1)"
echo "VAR1 = $VAR1"
v6Prefix=$(cat /tmp/igc0_prefixv6 | cut -d'/' -f1)
VAR2=$v6Prefix
echo "VAR2 = $VAR2"
if [ "$VAR1" != "$VAR2" ]; then
echo "$(date) Variables are not equal. Running code." >> $change_log
# Perform the find and replace operation
sed -i '' "s/$VAR1/$VAR2/g" "$FILE_NAME"
echo "$(date) Replacement complete in $FILE_NAME." >> $change_log
# Restart the Kea service to load the new prefix
pluginctl -s kea-dhcp restart; sleep 1
# Restart Router Advertisements to update clients
pluginctl -s radvd restart >> $change_log
sleep 1
# Log the event
echo "$(date) WAN IPv6 prefix change detected." >> $change_log
fi
echo "Done..."
exit








