Docs

Run two agents on two ISPs.

This is the practical setup for dual-internet resilience: one Beam Networks Stream agent on the primary connection, one on the backup connection, both reading the same OBS HLS output.

Recommended shape

  • Use the same stream_id on both agents.
  • Use different agent_id values, usually primary and backup.
  • Use different API keys so each agent can be rotated or revoked independently.
  • Use separate cache directories even if both agents watch the same HLS directory.

Example config split

stream_id: "your-stream-id"
agent_id: "primary"
api_endpoint: "https://ingest.beamnetworks.stream"
api_key: "sk-live-primary"
hls_watch_dir: "/tmp/obs-hls"
cache_dir: "/var/lib/beam-agent-primary"
stream_id: "your-stream-id"
agent_id: "backup"
api_endpoint: "https://ingest.beamnetworks.stream"
api_key: "sk-live-backup"
hls_watch_dir: "/tmp/obs-hls"
cache_dir: "/var/lib/beam-agent-backup"

Option A: Linux network namespaces

Use a dedicated namespace when both ISPs are connected to one Linux machine and you want hard separation between the two network paths.

  1. Create a namespace such as beam-backup.
  2. Move the second NIC into that namespace, or connect it with a veth pair.
  3. Assign the namespace its own IP and default route through ISP 2.
  4. Verify it exits a different public IP than the main namespace.
  5. Run the backup agent inside that namespace.
sudo ip netns exec beam-backup ./beam-agent --config /etc/beam/agent-backup.yaml

Option B: Policy routing

Use policy routing when both interfaces stay in the default namespace but outbound traffic should be pinned to different WAN links based on source IP or routing rules.

  1. Add a second routing table for the backup ISP.
  2. Add routes for that ISP into the new table.
  3. Add an ip rule matching the backup agent source IP.
  4. Bind the backup agent to that source IP if needed.
  5. Verify both agents exit through different public IPs before going live.

Verification checklist

  • Both agents can reach https://ingest.beamnetworks.stream.
  • Each agent exits through a different public IP.
  • The dashboard shows both primary and backup.
  • Stopping one agent does not stop the other path.
  • Duplicate segments are accepted without ingest errors.