Skip to main content

Environment Variables

mac env​

mac env lists settings that differ from the defaults; --all also shows the defaults, including variables not listed on this page. Secrets are masked; do not share unmasked output. After a change, restart the role and check mac status -v.

mac env
mac env --all
mac env set KEY=VALUE
mac env unset KEY
sudo mac env set --global KEY=VALUE
sudo mac env unset --global KEY

User settings in ~/.mac/env (mac env set) override node-wide settings in /etc/mango/mac/env (--global), which override the package defaults. Keep the master address, node name and token node-wide. To ignore user settings, prefix the command with sudo env MAC_IGNORE_USER_ENV=1. If commands warn permission denied for ~/.mac, fix its ownership with sudo chown.

Env files have no quoting, so mac env set refuses a value that starts with #, has # after a space or tab, or has leading or trailing blanks.

Variable Reference​

Common​

VariablePurpose
MASTER_IPMaster address; required on agents
NODE_NAMENode name; defaults to the hostname
MAC_NODE_IP_PREFIXPrefix selecting the host address on multi-address hosts
MAC_REGISTRYImage registry prefix
SDK_AGENT_IMAGESDK agent image, for private mirrors or RHEL-family nodes
MAC_VERSIONImage tag override; unset uses the installed version
MAC_OFFLINEtrue disables registry pulls; set by the offline installer
MAC_LOG_LEVELdebug, info (default), warn or error
MAC_ADMIN_PASSWORDInitial admin password, used only when no users exist
MASTER_API_PORT, MASTER_WEB_PORTAPI and dashboard ports; default 28080 and 23000

If mac status -v shows older images than mac version, unset MAC_VERSION. See Installation for the ports to open between hosts.

Node Authentication​

MAC_NODE_TOKEN is shared by the master and agents.

  • The first sudo mac start master creates /etc/mango/mac/node_token if no token is set.
  • Copy it securely into each agent's node-wide MAC_NODE_TOKEN; a mismatch prevents enrollment.
  • When enabling or rotating the token, restart the master first, then the agents.

TLS (HTTPS)​

VariablePurpose
MAC_TLS_ENABLEDtrue enables API and dashboard HTTPS
MAC_TLS_CERT_DIRHost directory containing server.crt and server.key
MAC_TLS_CERT_FILE, MAC_TLS_KEY_FILEOther file names in that directory, as /etc/mac/certs/<name>
MAC_TLS_PORT, MAC_WEB_TLS_PORTAPI and dashboard HTTPS ports; default 28443 and 23443

Without both files, the master does not start. HTTP ports stay open; restrict them with the host firewall if needed.

Switch Access​

VariablePurpose
SWITCH_USERSSH user; default admin
SWITCH_PASSWD_LISTComma-separated SSH password candidates
SNMP_COMMUNITYSNMP community; default public
SWITCH_MGMT_CIDRSSwitch management CIDRs/IPs that may receive credentials

gNMI Streaming Telemetry​

SONiC switches with gNMI use it; others use SNMP. Set GNMI_USERNAME and GNMI_PASSWORD; GNMI_ENABLED=false forces SNMP and GNMI_PORT defaults to 8080.

LLMBoost​

VariablePurpose
LLMBOOST_HOST_PORTSAgent ports to probe for models; unset disables probing
LLMBOOST_ENGINE_ENDPOINTSAdditional OpenAI-compatible engine URLs
LLMBOOST_ENABLEDfalse disables LLMBoost integration
LLMBOOST_DASHBOARD_URLGrafana link
K8S_API_ENDPOINT, K8S_API_TOKEN, K8S_NAMESPACESKubernetes discovery; see LLMBoost

MASS and BMC​

VariablePurpose
MASS_API_ENDPOINTMASS Manager API URL; unset disables integration
MASS_DASHBOARD_URLMASS dashboard link
MASS_USERNAME, MASS_PASSWORDMASS service account; set node-wide
MAC_BMC_USER, MAC_BMC_PASSWORDDefault BMC credentials for nodes without their own