Skip to content

support a network config overlay file#1903

Draft
stefanpenner wants to merge 1 commit into
firewalla:masterfrom
stefanpenner:network-config-overlay
Draft

support a network config overlay file#1903
stefanpenner wants to merge 1 commit into
firewalla:masterfrom
stefanpenner:network-config-overlay

Conversation

@stefanpenner

@stefanpenner stefanpenner commented Jun 6, 2026

Copy link
Copy Markdown

Part of a 2-PR stack: #1902 vxlan interface plugin · #1903 (this) network config overlay. Independent; better together.

Why

The app owns the entire sysdb:networkConfig, so there is no supported way to add your own interface that survives the app rewriting that config — or a reboot. An admin-defined vxlan LAN, for example, is dropped on the next app change.

How

Adds an optional ~/.router/config/network_config_overlay.json. It is deep-merged onto the active config when applying (tryApplyConfig) and when serving /config/active, and stripped back out in saveConfig — so it is never written into sysdb:networkConfig. The app's own config is therefore never touched: delete the file and the next apply reverts it; absent, it does nothing. Mirrors how the system config already overlays routeConfig.json (util/config.js).

{
  "interface": {
    "vxlan": {
      "vxlan99": {
        "enabled": true,
        "meta": { "type": "lan", "name": "exp" },
        "vni": 99,
        "intf": "br0",
        "local": "10.86.1.1",
        "remote": "10.86.1.32",
        "ipv4": "10.99.0.1/24"
      }
    }
  },
  "dhcp": {
    "vxlan99": {
      "gateway": "10.99.0.1",
      "subnetMask": "255.255.255.0",
      "range": { "from": "10.99.0.100", "to": "10.99.0.200" }
    }
  }
}

Deep-merge an optional ~/.router/config/network_config_overlay.json onto the
active config on apply and in /config/active, stripped before persisting to
sysdb:networkConfig. Lets an admin add interfaces that survive app re-push and
reboots without mutating the app-owned config. Mirrors routeConfig.json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stefanpenner stefanpenner force-pushed the network-config-overlay branch from ac83e46 to c4a9f58 Compare June 6, 2026 03:22
@stefanpenner stefanpenner changed the title Support an admin-managed network-config overlay support a network config overlay file Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant