From eb71234e5a75423937660fb0bff4b379d35af49a Mon Sep 17 00:00:00 2001 From: Aaron Bockelie Date: Tue, 16 Jun 2026 14:26:32 -0500 Subject: [PATCH] feat(appliance): show egress MAC on the console banner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The console banner already lists Web UI / Host mgmt / Hostname; add the egress interface's MAC so an operator can set a DHCP reservation (pin the appliance to a stable IP) straight from the console — no SSH, no hunting through 'ip link'. That reservation is the prerequisite for a public DNS A-record + TLS hostname (ADR-105). Adds egress_iface()/egress_mac() helpers mirroring primary_ip(). --- appliance/files/kg-console.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/appliance/files/kg-console.sh b/appliance/files/kg-console.sh index 9741e1e90..7013f9143 100755 --- a/appliance/files/kg-console.sh +++ b/appliance/files/kg-console.sh @@ -20,10 +20,24 @@ primary_ip() { | awk '{for (i=1;i<=NF;i++) if ($i=="src") {print $(i+1); exit}}' } +# Egress interface name + its MAC. Surfaced on the banner so an operator can set a +# DHCP reservation (pin the appliance to a stable IP) straight from the console — +# without SSH or hunting through `ip link`. The reservation is also the +# prerequisite for a public DNS A-record / TLS hostname (ADR-105). +egress_iface() { + ip route get 1.1.1.1 2>/dev/null \ + | awk '{for (i=1;i<=NF;i++) if ($i=="dev") {print $(i+1); exit}}' +} +egress_mac() { + local ifc; ifc="$(egress_iface)" + [ -n "${ifc}" ] && cat "/sys/class/net/${ifc}/address" 2>/dev/null +} + pause() { echo; read -rp " Press Enter to return to the menu... " _; } banner() { local ip; ip="$(primary_ip)"; ip="${ip:-(no network)}" + local ifc mac; ifc="$(egress_iface)"; mac="$(egress_mac)" clear 2>/dev/null || true cat <