diff --git a/ic-os/components/hostos/misc/limited-console b/ic-os/components/hostos/misc/limited-console index ce580ba0b7d1..2ab768fad850 100644 --- a/ic-os/components/hostos/misc/limited-console +++ b/ic-os/components/hostos/misc/limited-console @@ -16,7 +16,12 @@ show_menu() { echo " service-status - Show service status (usage: service-status )" echo " view-logs - View service logs (usage: view-logs )" echo " config-json - Show /boot/config/config.json" + echo " guestos-console-logs - Show GuestOS Serial Console Logs" echo " network-config-settings - Show network settings from config" + echo " network-interfaces - Show network interface status" + echo " ip-addresses - Show all IP addresses" + echo " ping-gateway - Test connectivity to IPv6 gateway" + echo " routes - Show routing table" echo " manual-recovery - Manual node recovery (ONLY FOR EMERGENCY USE)" echo " rbash-console - Drop into restricted bash console" echo " clear - Clear the console" @@ -68,6 +73,14 @@ execute_command() { PATH="$RESTRICTED_PATH" \ /usr/bin/less /boot/config/config.json ;; + "guestos-console-logs") + echo "=== GuestOS Serial Console Logs ===" + env -i \ + TERM="$TERM" \ + LESSSECURE=1 \ + PATH="$RESTRICTED_PATH" \ + /usr/bin/less -f /var/log/libvirt/qemu/guestos-serial.log + ;; "network-config-settings") echo "=== Network Settings from Config ===" local network_settings=$(get_config_value '.network_settings' 2>/dev/null) @@ -77,6 +90,35 @@ execute_command() { echo "No network settings found in config" fi ;; + "network-interfaces") + echo "=== Network Interface Status ===" + /bin/ip link show + ;; + "ip-addresses") + echo "=== IP Addresses ===" + /bin/ip addr show + ;; + "ping-gateway") + echo "=== Testing IPv6 Gateway Connectivity ===" + local gateway=$(/bin/ip -6 route show | awk '/^default/ {print $3}' | head -1) + if [ -n "$gateway" ]; then + echo "Gateway: $gateway" + echo "" + /bin/ping6 -c 4 "$gateway" 2>&1 + else + echo "No IPv6 gateway found in routing table" + echo "IPv6 routes:" + /bin/ip -6 route show + fi + ;; + "routes") + echo "=== Routing Table ===" + echo "IPv4 routes:" + /bin/ip -4 route show + echo "" + echo "IPv6 routes:" + /bin/ip -6 route show + ;; "manual-recovery") echo "=== Manual Node Recovery ===" echo "This will perform a manual node recovery. Do not attempt this unless you are certain it is appropriate." diff --git a/ic-os/hostos/context/packages.common b/ic-os/hostos/context/packages.common index 7b50c1f9ae35..41088115dc78 100644 --- a/ic-os/hostos/context/packages.common +++ b/ic-os/hostos/context/packages.common @@ -34,7 +34,9 @@ jq less lvm2 net-tools +netcat-openbsd nftables +traceroute # NODE-1718: Parted has a conflict with the new libvirt, install it below # parted python-is-python3 diff --git a/ic-os/hostos/context/packages.dev b/ic-os/hostos/context/packages.dev index c92d654ec711..35060d48c636 100644 --- a/ic-os/hostos/context/packages.dev +++ b/ic-os/hostos/context/packages.dev @@ -7,7 +7,6 @@ nano # packages requested by networking tcpdump iperf -netcat-openbsd curl iputils-ping