Native Proxy-based Egress Gateway Support

Overview

I would like to request native proxy-based Egress Gateway support in NetBird.

Currently, NetBird Exit Nodes provide a way to route traffic through another peer using IP forwarding and routing. However, there is no native way to forward client traffic through an upstream proxy service running on the gateway peer.

It would be valuable if NetBird could introduce a dedicated Egress Gateway feature that allows administrators to transparently route peer traffic through configurable upstream proxy services, without requiring users to configure system-level proxy settings on their devices.

This should be a standalone capability rather than an extension of the legacy Routes-based Exit Node implementation.

Core Requirements

1. Support Multiple Upstream Proxy Modes

Administrators should be able to select the upstream proxy protocol in the NetBird management dashboard:

  • HTTP Proxy – Forward TCP connections using HTTP CONNECT.

  • SOCKS5 Proxy – Forward TCP connections using SOCKS5 CONNECT and UDP traffic using UDP ASSOCIATE.

  • TUN Interface – Forward traffic through an upstream TUN-based network stack, enabling transparent TCP and UDP handling.

Each mode should allow administrators to configure the corresponding upstream endpoint, port or interface, and authentication settings where applicable.

2. Transparent Traffic Forwarding

Client devices should not need to configure HTTP, SOCKS, or system-level proxy settings manually.

Once an Egress Gateway and its policy are configured, NetBird should transparently capture and forward the selected traffic through the gateway and its upstream proxy.

The solution should support:

  • TCP and UDP traffic.

  • IPv4 and IPv6.

  • DNS traffic, preventing DNS leaks.

  • Appropriate handling of unsupported protocols and traffic types.

3. Centralized Management

Administrators should be able to configure everything from the NetBird management dashboard:

  • Create and manage Egress Gateways.

  • Select the gateway peer.

  • Choose an upstream proxy mode.

  • Configure upstream address, port, credentials, or TUN interface.

  • Assign gateways to peers or groups.

  • Define which traffic should use the gateway.

  • Monitor upstream connectivity and gateway health.

4. Traffic Policies and Security

The Egress Gateway should integrate with NetBird’s existing identity and access-control model.

Administrators should be able to define which peers or groups can use a particular gateway.

Additional requirements:

  • Fail-open / fail-closed behavior.

  • Direct traffic bypass rules.

  • DNS leak prevention.

  • Gateway health monitoring.

  • Clear handling of upstream proxy failures.

  • No unexpected direct Internet fallback when fail-closed is configured.

5. Independent Egress Gateway Architecture

This feature should introduce Egress Gateway as a first-class NetBird concept, independent of the legacy Routes model.

NetBird is moving toward Networks as the recommended model for private resource access. A new Internet egress capability should have its own management and policy model rather than introducing another long-term dependency on legacy Routes.

Networks, Access Policies, and Egress Gateways should have clearly separated responsibilities:

  • Networks: Private resource connectivity.

  • Access Policies: Identity-based access control.

  • Egress Gateways: Internet traffic egress selection and forwarding.

  • Upstream Adapters: Integration with HTTP, SOCKS5, and TUN-based proxy services.

Expected User Experience

For example, an administrator runs Mihomo on an Ubuntu peer and exposes:

  • HTTP proxy: 127.0.0.1:7890

  • SOCKS5 proxy: 127.0.0.1:7891

The administrator creates an Egress Gateway in NetBird, selects SOCKS5, configures 127.0.0.1:7891, and assigns the gateway to a group of Windows devices.

After applying the policy, those devices should automatically route their selected Internet traffic through the NetBird tunnel, the Ubuntu gateway, and finally Mihomo.

Users should not need to configure a proxy in Windows or change their application settings.

Goal

The goal is to make NetBird a complete zero-configuration networking solution that supports not only private network connectivity, but also centralized, identity-aware, proxy-based Internet egress.

This would make NetBird significantly more flexible for users and organizations that already operate HTTP, SOCKS5, or TUN-based proxy infrastructure.