Skip to content

Agent Configuration

The MoeNet Agent is configured via a JSON file with the following sections.

Modes

Minimal config — the agent fetches remaining settings from the Control Plane at startup:

json
{
  "controlPlane": {
    "url": "https://api.moenet.work",
    "token": "your-agent-token"
  },
  "server": {
    "listen": ":24368"
  }
}

Bootstrap automatically fetches: node ID, region, loopback IPs, ASN, mesh peers, iBGP peers.

Full Configuration

See below for all available sections.

Configuration Sections

server

json
{
  "server": {
    "listen": ":24368",
    "readTimeout": 30,
    "writeTimeout": 30,
    "idleTimeout": 120
  }
}
FieldTypeDefaultDescription
listenstring:24368HTTP listen address
readTimeoutint30Read timeout (seconds)
writeTimeoutint30Write timeout (seconds)
idleTimeoutint120Idle timeout (seconds)

node

json
{
  "node": {
    "name": "jp-edge",
    "id": 1,
    "region": "ap-northeast",
    "location": "Tokyo",
    "provider": "Vultr"
  }
}

INFO

In Bootstrap mode, name is the only required field. Other fields are fetched from the Control Plane.

controlPlane

json
{
  "controlPlane": {
    "url": "https://api.moenet.work",
    "token": "your-agent-token",
    "requestTimeout": 15,
    "heartbeatInterval": 30,
    "syncInterval": 60,
    "metricInterval": 60,
    "maxRetries": 3,
    "retryInitialDelay": 1000
  }
}
FieldTypeDefaultDescription
urlstringrequiredControl Plane API URL
tokenstringrequiredAgent authentication token
requestTimeoutint15HTTP request timeout (seconds)
heartbeatIntervalint30Heartbeat interval (seconds)
syncIntervalint60Session sync interval (seconds)
metricIntervalint60Metric report interval (seconds)
maxRetriesint3Max retry attempts
retryInitialDelayint1000Initial retry delay (ms)

bird

json
{
  "bird": {
    "controlSocket": "/var/run/bird/run/bird.ctl",
    "poolSize": 5,
    "poolSizeMax": 64,
    "peerConfDir": "/etc/bird/peers",
    "ebgpConfTemplateFile": "/opt/moenet-agent/templates/ebgp.conf.tmpl",
    "ibgpConfDir": "/etc/bird/ibgp.d"
  }
}
FieldTypeDefaultDescription
controlSocketstring/var/run/bird/run/bird.ctlBIRD control socket path
poolSizeint5Connection pool initial size
poolSizeMaxint64Connection pool max size
peerConfDirstring/etc/bird/peerseBGP peer config directory
ebgpConfTemplateFilestringeBGP config template path
ibgpConfDirstring/etc/bird/ibgp.diBGP config directory

wireguard

json
{
  "wireguard": {
    "privateKeyPath": "/etc/wireguard/private.key",
    "publicKeyPath": "/etc/wireguard/public.key",
    "configDir": "/etc/wireguard",
    "persistentKeepaliveInterval": 25,
    "dn42Ipv4": "",
    "dn42Ipv6": "",
    "dn42Ipv6LinkLocal": "fe80::1"
  }
}

WARNING

MoeNet Agent uses direct kernel WireGuard interface management. Do NOT use wg-quick.

metric

json
{
  "metric": {
    "pingTimeout": 5,
    "pingCount": 4,
    "pingWorkers": 32
  }
}

autoUpdate

json
{
  "autoUpdate": {
    "enabled": true,
    "checkInterval": 60,
    "channel": "stable",
    "githubRepo": "heichaowo/moenet-agent"
  }
}
FieldTypeDefaultDescription
enabledbooltrueEnable auto-update
checkIntervalint60Check interval (minutes)
channelstringstableRelease channel: stable, beta, dev
githubRepostringheichaowo/moenet-agentGitHub repository for releases

Full Example

See config.example.json for the complete configuration file.

MoeNet DN42 Network — AS4242420998