Skip to content

NUC Operations Runbook

SSH Access

There are four methods to SSH into the NUC, listed in order of preference:

Method Command / Access When to Use
Cloudflare Tunnel ssh nuc.astradial.com (via cloudflared) Primary method, works from anywhere
Local WiFi ssh user@192.168.0.13 When on the same local network
Local USB Ethernet ssh user@192.168.0.14 Direct physical connection to NUC
Cloud Hop ssh root@89.116.31.109 then ssh 10.10.10.2 When tunnel is down, WireGuard still up

IP Addresses .13 and .14

192.168.0.13 (WiFi) and 192.168.0.14 (USB Ethernet) are the same NUC. They are two different network interfaces on the same machine.

After Reboot Checklist

After a NUC reboot, verify each component in this order:

1. WireGuard Tunnel

systemctl status wg-quick@wg0
wg show wg0
ping -c 3 10.10.10.1   # Ping cloud end of tunnel

2. NNI Interface (enp86s0)

ip link show enp86s0       # Should be UP
ip addr show enp86s0       # Should have NNI IP assigned

3. Routes

ip route show
# Verify routes for Tata network via NNI gateway exist

4. Asterisk

systemctl status asterisk
asterisk -rx "core show uptime"
asterisk -rx "pjsip show endpoints"

Wait Before Testing Calls

After Asterisk starts, wait 30-60 seconds before placing test calls. The first call after restart may fail. See Troubleshooting - Error 7.

5. Cloudflared

systemctl status cloudflared

6. Netdata

systemctl status netdata
curl -s http://localhost:19999/api/v1/info | head -c 100

Auto-Start Services

All critical services are configured to start automatically via systemd:

Service Unit Auto-Start
WireGuard wg-quick@wg0.service Yes
Asterisk asterisk.service Yes
Cloudflared cloudflared.service Yes
Netdata netdata.service Yes

Starting and Stopping Asterisk

# Start
systemctl start asterisk

# Stop (drops all active calls)
systemctl stop asterisk

# Restart (drops all active calls)
systemctl restart asterisk

# Reload configuration without dropping calls
asterisk -rx "module reload res_pjsip.so"
asterisk -rx "dialplan reload"

Stopping Asterisk

Stopping or restarting Asterisk immediately drops all active calls. Prefer module reload and dialplan reload to apply configuration changes without disruption.

Live Debugging

Asterisk CLI

# Connect to running Asterisk with verbose output
asterisk -rvvvvv

Common CLI commands:

pjsip set logger on           ; Enable SIP message logging
pjsip set logger off          ; Disable SIP message logging
pjsip show endpoints          ; List all endpoints and status
pjsip show endpoint <name>    ; Show endpoint details
pjsip show aor <name>         ; Show AOR and contacts
core show channels            ; List active calls
dialplan show <context>        ; Show dialplan for context

Packet Capture

# Capture SIP traffic on NNI interface
tcpdump -i enp86s0 -n port 5060 -w /tmp/sip-capture.pcap

# Capture all SIP traffic on all interfaces
tcpdump -i any -n port 5060

# Interactive SIP call flow viewer
sngrep

sngrep

sngrep provides a real-time, interactive view of SIP call flows. It is the fastest way to diagnose SIP signaling issues.

Configuration Files

Path Purpose
/etc/asterisk/pjsip.conf Main PJSIP configuration (includes other files)
/etc/asterisk/pjsip_tata_gateway.conf Tata gateway endpoint, AOR, identify
/etc/asterisk/pjsip_transport.conf SIP transports (UDP, TCP, WSS)
/etc/asterisk/extensions.conf Main dialplan (includes other files)
/etc/asterisk/ext_tata_gateway.conf Tata inbound and DID routing dialplan
/etc/wireguard/wg0.conf WireGuard tunnel configuration
/etc/network/interfaces.d/enp86s0 NNI interface persistent configuration
/etc/systemd/system/asterisk.service Custom Asterisk systemd unit
/etc/cloudflared/config.yml Cloudflare tunnel configuration

Known Quirks

tata_gateway Shows Unavailable

The tata_gateway endpoint will always show as "Unavailable" in pjsip show endpoints. This is normal. Tata does not respond to SIP OPTIONS qualify requests. The trunk works regardless. Test with actual calls to verify connectivity.

192.168.0.13 and 192.168.0.14 Are the Same NUC

The NUC has two local network interfaces: WiFi (.13) and USB Ethernet (.14). Both reach the same machine. If one is unreachable, try the other.

Module 'Declined' Errors at Startup

When Asterisk starts, several modules may log "declined" messages. These are harmless -- they indicate optional modules that were not loaded because their dependencies are not present or they are not needed in this configuration. They do not affect PBX operation.