#!/bin/execlineb -P # SPDX-License-Identifier: EUPL-1.2+ # SPDX-FileCopyrightText: 2020-2022, 2025 Alyssa Ross background { importas -Si INTERFACE # Our IP is encoded in the NIC-specific portion of the interface's MAC # address. backtick -E LOCAL_IP { awk -PF: " BEGIN { ex = 1 } $1 == \"02\" && $2 == \"00\" { printf \"100.64.%d.%d\\n\", \"0x\" $5, \"0x\" $6 ex = 0 } END { exit ex } " /sys/class/net/${INTERFACE}/address } if { ip address add ${LOCAL_IP}/32 dev $INTERFACE } if { ip link set $INTERFACE up } if { ip route add 169.254.0.1 dev $INTERFACE } ip route add default via 169.254.0.1 dev $INTERFACE }